Optimize webpack-builder: minify using swc#22843
Merged
Merged
Conversation
Member
Author
|
Terser: SWC: before: This data is from an extremely small storybook, I'll do a little investigation on a larger one. |
Member
Author
|
I asked @JonathanKolnik to test this change on the chromatic storybook and we saw this: Before: After: |
Member
Author
|
@jonniebigodes When we're writing the docs for the useSWC feature flag, it should mention that besides changing the babel-loader to csw-loader, it also switches TerserPlugin for scwMinify (after this PR is merged) |
Contributor
|
Appreciate the heads up @ndelangen, I think we have time between the change being up and it getting published 🙏 |
Member
Author
|
@shilman self-merging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found that terserPlugin support swc, and considering what we use to optimize storybook with isn't really a public API anyway... I figured I could just sneak this in and replace terser with swc.
see: https://webpack.js.org/plugins/terser-webpack-plugin/#swc
Related: #18329
Related: #19994
Related: #15548