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

Doesn't seem to work when module re-exporting is involved #53

Open
priyajeet opened this issue May 3, 2017 · 1 comment
Open

Doesn't seem to work when module re-exporting is involved #53

priyajeet opened this issue May 3, 2017 · 1 comment

Comments

@priyajeet
Copy link

priyajeet commented May 3, 2017

I forked your repo, and changed the layout a bit.

You can see it here
https://github.com/priyajeet/babel-webpack-tree-shaking

Essentially added index.js to both app folder and at the root level that now serves as the main entry. Hopefully I didn't configure it incorrectly. Module re-exporting I think is a norm when dealing with lots of components being distributed as a library. Realistically, index.js at the root level will again re-export like export * from './app' when the whole project is being distributed as an npm bundle so that the host project does import {SportsCar} from 'babel-webpack-tree-shaking' and then this host project will end up including everything. For the sake of this example, it serves as the main entry point.

@priyajeet
Copy link
Author

priyajeet commented May 3, 2017

I do notice that once the babel-loader is removed from the webpack rules, then tree shaking happens fine. But unfortunately you need that loader, for say React etc.

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

No branches or pull requests

1 participant