chore(package.json): Add sideEffects: false field in package.json #8099
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.
What kind of change does this PR introduce? (check at least one)
package.json
field additionDoes this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
dev
branch for v2.x (or to a previous version branch), not themaster
branchfix #xxx[,#xxx]
, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
This PR adds the
"sideEffects": false
property in vue'spackage.json
file. This allow's webpack (for those who want to opt-in to requiring vue's original source files (instead of the flattened esm bundles) and want to remove flow type through a babel-transform, then this will allow webpack to aggressively ignore and treeshake unused exports throughout the module system.In many cases this can yield hidden and surprising build time improvements and size reductions in the case that modules flattened from rollup aren't actually needed when webpack performs a scope analysis.
The angular team has adopted this approach for the CLI yielding some strong build time speed for webpack (since unused exports are also not resolved, parsed, etc.). From my assessment of the module graph created, it looks that there are no sideEffects created against existing re-exports throughout the codebase, therefore even if a user did opt in on their own will, and remove flow types, there should be no danger of removing code that is needed and causing breakages.
Overall, this already will not be a breaking change in any way but just provides extra benefits to those (and for the cli (if realized) when using webpack 4 and
mode: production
).Happy to answer any other questions.
~Sean + webpack team
Other information: