SideEffects false
See original GitHub issueRe package.json with sideEffects = false
, there are a bunch of /*@__PURE__*/
comments around the code that I think we can safely get rid of? would that be correct @marcofugaro ?
I can make a PR for it if so.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Tree Shaking - webpack
All the code noted above does not contain side effects, so we can mark the property as false to inform webpack that it...
Read more >What Does Webpack 4 Expect From A Package With sideEffects
The "sideEffects": false flag in big-module's package.json indicates that the package's modules have no side effects (on evaluation) and ...
Read more >false flag to package.json to allow tree shaking · Issue #16059 ...
Consider adding "sideEffects": false to package.json so that bundlers like webpack are able to tree shake three.js.
Read more >Everything you never wanted to know about side effects
In this blog post I'll explain what side effects are, why webpack needs to ... In that situation, you can simply set sideEffects...
Read more >Tree Shaking Examples - Katerina198b
In this example, the final bundle must contain sideEffect.js module, ... side effects you can to drop them with /*#__PURE__*/ or sideEffects: false...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Not quite,
sideEffects: false
just tells the bundler that we don’t attach anything to the window or any other global scopes.It’s up to the bundler to understand what to remove and what not to. From the webpack tree-shaking guide:
We can actually test this now, the
test-treeshake
script is testing importing three.js like if it was a npm module:https://github.com/mrdoob/three.js/blob/c9350382c50e549c0d2960041448ffe652bbbd9b/test/treeshake/index.js#L1
If you remove all
/*@__PURE__*/
and runnpm run build && npm run test-treeshake
you can see the threeshaken bundle size actually increase.thank you all