Repository navigation
fix(build): let the bundle analyzer read docs client source maps - #1482
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
Bundle sizeClient 804.7 kB (no change) · Server 1.60 MB No route loads 100 B more or less before it renders. Largest changes in the client
And 266 more packages or files. Largest changes in the server
And 465 more packages or files. Brotli sizes. Changes under 100 B are left out of the tables. Measured by nuxt-bundle-analyzer for |
This branch was successfully deployed
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.
Why
On the bundle-size page, every chunk showed "None of your files are in this chunk".
docs/nuxt.config.tssetvite.build.sourcemap: false, which @nuxt/vite-builder applies overnuxt.options.sourcemap. The analyzer setssourcemap.client: 'hidden'while it runs, but that setting lost, so no client.mapfiles were written and Sonda couldn't split chunks into files and packages.What changed
vite.build.sourcemap: falseblock fromdocs/nuxt.config.ts. Client source maps are already off by default in production, and the sourcemap warnings it was added to hide no longer appear.Evidence
npx --yes [email protected] docs --extends ../layer --no-serve,client.json:chunkresources_...slug_.jsPlain
nuxt build docs --extends ../layer, before and after: 0.mapfiles in.output/public, 178 in.output/server, no "Sourcemap is likely to be incorrect" warnings.ELI5
The bundle report breaks each JavaScript file into the source files it came from, using a map the build writes next to it. A docs setting stopped those maps from being written, so the report had nothing to break down. Removing that setting lets the report work, and normal builds still ship no maps.
🤖 Generated with Amp, reviewed by @larbish before opening.