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

Tree-shaking is not happening #780

Closed
krazyjakee opened this issue Oct 10, 2018 · 6 comments
Closed

Tree-shaking is not happening #780

krazyjakee opened this issue Oct 10, 2018 · 6 comments

Comments

@krazyjakee
Copy link

krazyjakee commented Oct 10, 2018

The webpack plugin "ModuleConcatenationPlugin" doesn't seem to run in production mode.

Any import { x } from 'x' adds the entire module x to the production bundle.

What could be causing this?

Here is a minimal example of this issue in action: https://github.com/krazyjakee/Razzle-Sandbox/blob/tree-shaking/src/App.js#L2

You can see the entire date-fns package is imported to the bundle when running npm run build.

@krazyjakee
Copy link
Author

Updated with an example repo

@krazyjakee
Copy link
Author

@jaredpalmer confirmed this is planned for V4 and is not a bug, just not implemented.

https://spectrum.chat/notifications?thread=68062cb8-a254-43c2-9330-69e537a9753d

@jaredpalmer jaredpalmer mentioned this issue Nov 15, 2018
Merged
5 tasks
@stale
Copy link

stale bot commented Dec 9, 2018

Hola! So here's the deal, between open source and my day job and life and what not, I have a lot to manage, so I use a GitHub bot to automate a few things here and there. This particular GitHub bot is going to mark this as stale because it has not had recent activity for a while. It will be closed if no further activity occurs in a few days. Do not take this personally--seriously--this is a completely automated action. If this is a mistake, just make a comment, DM me, send a carrier pidgeon, or a smoke signal.

@stale stale bot added the stale label Dec 9, 2018
@krazyjakee
Copy link
Author

This is fixed in v4

@stale stale bot removed the stale label Dec 9, 2018
@mrmartineau
Copy link

@krazyjakee don't you mean v3?

@krazyjakee
Copy link
Author

@mrmartineau sorry getting ahead of myself

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

2 participants