-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Switch to SWC minifier by default #8860
Conversation
# Conflicts: # packages/core/utils/src/index.js
FYI I had to switch back since my .terserrc is not supported:
|
@danieltroger Please open a new issue with the actual error message about which property isn't supported. Ideally in the swc repo |
* upstream/v2: (128 commits) [webextension] Add support for `chrome_style` (#8867) Switch to SWC minifier by default (#8860) Use BitSet for bundler intersections (#8862) best key logic truncating package names (#8865) Add support for loadConfig to resolver plugins (#8847) Missing edge for multiple targets (#8854) Split large runtime manifest into separate bundles (#8837) Improvements to new resolver (#8844) Fix published files for resolver New resolver implementation in Rust (#8807) Update yarn.lock (#8843) Bump napi-rs to latest (#8838) Support .proxyrc.cjs (#8833) Sort global deps before injecting imports (#8818) Sort CSS module exports (#8817) fix: add extra information to unique bundles (#8784) Don't blow up HMR when <link />s don't have hrefs (#8800) v2.8.3 Changelog for v2.8.3 Address bug by updating an asset reference and merge conditions (#8762) ...
When building my app with parcel 2.10.2 vs 2.8, my bundle is ~15% larger. I inspected the minified bundle and found that no comments were being removed at all. I added this to a {
"format": {
"comments": "some"
}
} Whereas parcel 2.8 would leave only the copyright/license comments by default. Is the intention to default to leaving comments in the minified bundle in parcel 2.10? |
Looks like there was a regression in SWC minifier recently. But appears to be fixed in the latest nightly version of |
This replaces Terser with the SWC minifier by default. In testing large real-world apps, we see a significant performance improvement of 15-20% with slightly smaller output as well. Since SWC supports the same configuration options as terser, it is a drop in replacement. Next.js recently enabled it by default as well, so it seems stable at this point.
Aside from switching the default config over, this also fixes a few tests that now have slightly different output, and converts errors to Parcel diagnostics.