2

I'm trying to enhance my tree shaking skills with web pack:

After reading documentation regarding webpack treeshaking, and in particular the side effect flag (that can be used in package.json to tell wether a lib has side effect free or not), I ended up with the following question:

Why is this side effect notion only "configurable" at the package level , and not at the (es6) module level ?

I mean: is webpack smart enough to know automatically if an es6 module has side effect ? In which case it shouldn't be tree shaked ?

Thanks !

Clement
  • 3,860
  • 4
  • 24
  • 36
  • Also related: https://stackoverflow.com/questions/49160752/what-does-webpack-4-expect-from-a-package-with-sideeffects-false – mesqueeb Jan 18 '20 at 23:05

0 Answers0