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.
This PR supersedes and closes #1102
It does not use the same approach as proposed in #1102 however; seeing the current v2 build uses
preserveModules
. However, because of how the SFC gets split in multiple virtual chunks this causes a lot of unwanted files to clutter the build making it larger than it needs to be.The approach proposed in this PR mitigates it by using manualChunks to achieve the intended result of a 1:1 mapping between Vue files and the resulting JS files. A little hack has been introduced as well to properly name chunk files with the right file extension and without a hash.
Minification has been disabled: along with the drop of hashes the intent is to make eventual dependency patches less brittle (see last comment of #908 for a use-case). This is also yet-another-attempt at building with sourcemaps enabled 😄
Package size measurements: measured by running
pnpm run build-only; du -sh dist
inpackages/core
.Footnotes
these numbers were obtained by replacing the manual chunking approach from this PR by the manual chunking approach used in build: improve support for code splitting, ditch umd, sourcemaps #1102. Does not include the more heavy-handed dual config approach for esm and cjs. ↩