-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Align module exports with webpack #5316
Comments
Looks like this is the code that will need to be updated:
I think this is the equivalent code from Webpack: The format of the bindings (either |
try newTreeshaking |
This issue isn't related to tree shaking |
Need full support of runtime template and It is recommended to use gzip for further compression, so that these duplicate |
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
I'm also coming up against this issue, where arrow functions are being converted to If it helps, adding this to the minimiser config forces the keeping of arrow functions, however shouldn't be needed:
|
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
bump |
@ahabhgk can you confirm whether it's solved? |
I've also seen issues where browserslist config wasn't being respected. To get around it, I have to pass |
@isuro Do you mean builtin:swc-loader didn't respect the |
I think it may be swc-project/swc#3365 |
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
bump |
Bump from a very eager user of Docusaurus 😁 |
Bump Our build increased by quite a bit from webpack without the arrow functions. So much so that the switch is potentially going to be held back due to the artifact size ☹ |
System Info
System:
OS: macOS 12.4
CPU: (10) arm64 Apple M1 Max
Memory: 22.38 GB / 64.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 20.5.0 - ~/Library/Caches/fnm_multishells/61564_1700104358947/bin/node
Yarn: 1.22.17 - ~/.yarn/bin/yarn
npm: 9.8.0 - ~/Library/Caches/fnm_multishells/61564_1700104358947/bin/npm
pnpm: 8.10.5 - ~/Library/Caches/fnm_multishells/61564_1700104358947/bin/pnpm
bun: 0.8.1 - ~/.bun/bin/bun
Browsers:
Chrome: 119.0.6045.105
Safari: 15.5
Details
I've noticed that
rspack
build artifacts are typically larger than whatwebpack
generates.One of the contributing factors is how exports are generated.
Example file:
webpack
will generate the following code:rspack
generates this code:When minified,
webpack
is able to be compressed more, because the export bindings use() =>
instead offunction(){return}
webpack
compressed (pretty formatted for readability):rspack
compressed (pretty formatted for readability):For modules that contain lots of exports, this causes the size of
rspack
to grow quite a bit larger thanwebpack
. Aligning with webpack would lead to more optimized bundlesReproduce link
https://github.com/JohnDaly/rspack-export-alignment-with-webpack/
Reproduce Steps
Compare the output between
rspack
andwebpack
and notice thatwebpack
has smaller outputThe text was updated successfully, but these errors were encountered: