Skip to content

Commit

Permalink
Pass same mangling option as terser to SWC minifier (#56281)
Browse files Browse the repository at this point in the history
### What?

Pass `keep_classnames: true` to the SWC minifier, as we are passing it to `terser`.

### Why?

https://github.com/vercel/next.js/blob/5f7faac1e676be0819dd5d828bffed8a7105a78e/packages/next/src/build/webpack-config.ts#L953-L958

### How?

Closes WEB-1676
Fixes #55682
  • Loading branch information
kdy1 authored Oct 2, 2023
1 parent 5f7faac commit 83c18de
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,12 @@ export class TerserPlugin {
}
: {}),
compress: true,
mangle: true,
// This is the same option as terser
mangle: {
toplevel: true,
keep_classnames: true,
keep_fnames: true,
},
}
)

Expand Down

0 comments on commit 83c18de

Please sign in to comment.