-
-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idenfity if a package has a sideEffects: false
field in package.json
#52
Comments
Potentially could add the annotation here: Lines 316 to 324 in d8202a9
|
Hi @TheLarkInn. Thanks for writing in. What kind of improvements in size does one generally see when using a sideEffects:true package versus otherwise? Also, which webpack versions support this at the moment? |
Hi there! The sizes can be incredibly significant. With lodash-es, a single import with sideEffects: false now in their package.json takes a 60kb hit to 1-2kb. However not every library will exhibit this behavior. Also it will be as of webpack 4 and on. |
Does the difference hold in addition to the existing way of treeshaking using |
I've added supports for indexing the |
I believe Wepback@4 has been released, is this available? |
This is available in the quick info bar just below the search input. 🎊 |
Type
Feature Request
With webpack v4 around the corner, it would be awesome to denote to users searching for packages if their package (in addition to using the "module" field), also is "sideEffect free". We have package authors (see lodash-es) annotate this using a new field called "sideEffects: false". If this is set, webpack can perform even deeper optimizations to a library using ESM. (Also builds are faster because we skip evaluation of those unused exports).
The text was updated successfully, but these errors were encountered: