Skip to content

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

Open
Tom910 wants to merge 1 commit into
mridgway:mainfrom
Tom910:improve-tree-shaking
Open

Improved tree shaking in the library by adding sideEffects = false#95
Tom910 wants to merge 1 commit into
mridgway:mainfrom
Tom910:improve-tree-shaking

Conversation

@Tom910

@Tom910 Tom910 commented Feb 21, 2020

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown
Contributor

Probably won't work without this
#86

@Tom910

Tom910 commented Feb 21, 2020

Copy link
Copy Markdown
Author

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

@neoncube2

Copy link
Copy Markdown

@MichaelDeBoey or @mridgway, Any chance of this getting merged? :)

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.

4 participants