MetaMask / metamask-module-template

A simple template repository for starting new modules in the latest MetaMask fashion.
26 stars 23 forks source link

Add `sideEffects: false` to `package.json` #204

Closed Mrtenz closed 1 year ago

Mrtenz commented 1 year ago

By setting sideEffects: false, we can mark the package as side-effect-free:

https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free

This will improve the effectiveness of tree-shaking.

wachunei commented 1 year ago

I'm concerned about the cases a package is created using this template that actually has side effects and the import of the side effect gets removed, maybe we should have a explicit README section to remember to change this option.

Mrtenz commented 1 year ago

I'm concerned about the cases a package is created using this template that actually has side effects and the import of the side effect gets removed, maybe we should have a explicit README section to remember to change this option.

Good point. I've added a mention to the README.