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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle with Rollup instead of Webpack #1

Closed
wants to merge 1 commit into from

Conversation

billyjanitsch
Copy link

Hi @mjackson!

I'm opening this PR in regards to your suggestion of using Rollup instead of Webpack to get tree-shaking working: remix-run/react-router#6608 (comment)

Unfortunately, even if we switch from Webpack to Rollup with a proper dead-code elimination config, tree-shaking still doesn't work. Note that createHashHistory still unnecessarily appears in the output. 馃槩

(This happens for a similar reason as with Webpack. Rollup is only able to look at a single, bundled react-router-dom.js which contains all of the history imports. Its static module analysis isn't smart enough to determine that e.g. HashRouter, and therefore createHashHistory, are unused. HashRouter does get eliminated later in DCE by the minifier, but, by then, the entire history module has been included in the bundle. You can confirm this by commenting out the minifier plugin in the Rollup config.)

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