Skip to content
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

Improved tree shaking in the library by adding sideEffects = false #95

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Tom910
Copy link

@Tom910 Tom910 commented Feb 21, 2020

We can hel webpack remove code if we mark package without side effects - https://webpack.js.org/guides/tree-shaking/\#mark-the-file-as-side-effect-free

@coveralls
Copy link

Coverage Status

Coverage remained the same at 88.05% when pulling cd7e7b4 on Tom910:improve-tree-shaking into 3b8def9 on mridgway:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 88.05% when pulling cd7e7b4 on Tom910:improve-tree-shaking into 3b8def9 on mridgway:master.

@TrySound
Copy link
Contributor

Probably won't work without this
#86

@Tom910
Copy link
Author

Tom910 commented Feb 21, 2020

Probably won't work without this

Yes, you right it changes don't work for webpack 4. But if we used webpack 5 work fine. I create a repo for testing tree shaking - https://github.com/Tom910/webpack-tree-shaking-commonjs-mix

With sideEffect=false
with-sideEffect

Without sideEffect
without-sideEffect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants