webpack tree shaking and split chunks together
Asked Answered
K

0

7

We are using webpack splitChunks for bundling shared packages, now we did tree shake on our modules. (Our icons, ui components, hooks and helpers are npm package).

The problem is, our packages are fully tree shakable, but with splitChunks all of our packages considered as vendor~main.js and import without any tree shaking.

Do tree shaking only work for local imports? How we should use both tree shaking and splitChunks for npm packages?

Konstanze answered 26/2, 2020 at 6:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.