common-shakeify
common-shakeify copied to clipboard
Does not shake off other modules when importing with default
This plugin works great but unfortunately it does not allow to import default
exports only.
Steps to reproduce:
- Checkout https://github.com/Sobesednik/bs-sh on github
-
git clone https://github.com/Sobesednik/bs-sh.git
-
cd bs-sh
-
npm i
-
npm t
This is most likely because default imports get wrapped in a _interopDefault
function call by Babel. common-shake
does not know what this function does (it could do anything) so it marks all properties of the entire require()
call as "used" just to be safe. common-shake works best with untranspiled CommonJS modules. ES modules will likely get better support in browserify itself after Node settles on an implementation.