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

Replace terser with esbuild or swc minifier #7847

Closed
guoyunhe opened this issue Mar 21, 2022 · 3 comments
Closed

Replace terser with esbuild or swc minifier #7847

guoyunhe opened this issue Mar 21, 2022 · 3 comments

Comments

@guoyunhe
Copy link

馃檵 feature request

Minification can take 30~50% of total production building time. However, terser isn't very good in performance. In our project, replacing terser with esbuild, reduced our build time by 34%. swc's minification is also very fast.

馃 Expected Behavior

Use fast esbuild or swc as minifier.

馃槸 Current Behavior

Use slow terser as minifier.

馃拋 Possible Solution

馃敠 Context

馃捇 Examples

@mischnic
Copy link
Member

You can swap out the terser optimizer yourself with @parcel/optimizer-swc or @parcel/optimizer-esbuild. But we've found that, for now, they are either producing bigger or invalid output: #7212 (comment)

.parcelrc:

{
	"extends": "@parcel/config-default",
	"optimizers": { "*.js": ["@parcel/optimizer-swc"] }
}

@guoyunhe
Copy link
Author

What is the current state of swc and esbuild optimizer?

@mischnic
Copy link
Member

The next Parcel release is going to use swc by default: #8860

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