Open josetapadas opened 5 years ago
Well, the sideEffects
flag allows to opt-in for side-effect-free mode (or partial side-effect-free mode when specifying some paths rather than false
). If we module does not declare it, it is the same than declaring sideEffects: true
. So this is already working that way.
Hello,
So there is a big discussion about how self executing functions or side effects are being shaked off when, for example, you directly import one poly fill.
Imagine the following scenario:
App A includes a component from module M.
Module M imports one of your polyfills P.
When webpack compiles A, as your module has no sideEffects in package.json, it simply thinks that P is dead code.
(A nice discussion can be followed at : https://github.com/webpack/webpack/issues/6571)
What do you think of adding sideEffects to this library package.json?
Thank you!