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

Does not shake off other modules when importing with default #13

Open
z-vr opened this issue Jan 19, 2018 · 1 comment
Open

Does not shake off other modules when importing with default #13

z-vr opened this issue Jan 19, 2018 · 1 comment

Comments

@z-vr
Copy link

z-vr commented Jan 19, 2018

This plugin works great but unfortunately it does not allow to import default exports only.

Steps to reproduce:

  1. Checkout https://github.com/Sobesednik/bs-sh on github
  2. git clone https://github.com/Sobesednik/bs-sh.git
  3. cd bs-sh
  4. npm i
  5. npm t
@goto-bus-stop
Copy link
Member

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.

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

No branches or pull requests

2 participants