-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
[Question] Tree Shaking howto? #2999
Comments
Tree Shaking si enabled by default in next as long as you're not using a babel preset that transforms imports in commonjs, also next is using |
Are you sure?, because in webpack.js there is a plugin to get it back to commonjs https://github.com/arunoda/next.js/blob/68738d1c904476e9c99989ae5ee12a90c184fbc1/server/build/webpack.js#L228 |
Yes, I already asked something similar some days ago Edit: the source is slack |
We can either close this issue. Or submit a simple PR to verify the tree shaking output for the people to believe in. |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
Because code is run on browser and server, we cannot take full advantage of webpack tree shaking. The code is transformed to commonjs before anything.
How is it possible to take full advantage of tree shaking? (I've tried webpack-common-shake without success)
ESM is landing in node 8.5 with --experimental-module and also available with @std/esm package. Do you have any plan about this?
The text was updated successfully, but these errors were encountered: