You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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 bothapp
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 likeexport * from './app'
when the whole project is being distributed as an npm bundle so that the host project doesimport {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.The text was updated successfully, but these errors were encountered: