nuxt: disable nitro server sourcemaps - #5637
Merged
Merged
Conversation
Nitro defaults sourceMap to true, so every server chunk gets a .mjs.map alongside it in the Netlify functions bundle. Turning it off trims those files from the output and shaves a few seconds off the nitro server build. Tradeoff: server-side stack traces in the Netlify function logs no longer resolve back to the original source.
Contributor
Author
|
I think these are mostly relevant when developing locally, not for when previewing builds on netlify 🤔 |
✅ Deploy Preview for flowforge-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for flowforge-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Sets
nitro.sourceMap: falseinnuxt/nuxt.config.ts. Nitro's default istrue, which emits a.mjs.mapnext to every server chunk. On run 32107141754 that was 186 map files in the Netlify functions bundle.The win is marginal and worth stating plainly: it removes those files from the output and takes a few seconds off the nitro server build, which was 21.6s of a 24m15s job. It is not a meaningful change to overall build time.
The cost: sourcemaps are what make a server-side stack trace in the Netlify function logs readable. Without them, runtime errors in the SSR fallback are harder to trace back to source. If you would rather keep that debuggability, closing this PR is the right call and costs nothing.
Related Issue(s)
None
Checklist