File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
webpack/plugins/minify-webpack-plugin/src Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -1207,7 +1207,10 @@ export default async function getBaseWebpackConfig(
12071207 // @ts -ignore No typings yet
12081208 const { MinifyPlugin } =
12091209 require ( './webpack/plugins/minify-webpack-plugin/src/index.js' ) as typeof import ( './webpack/plugins/minify-webpack-plugin/src' )
1210- new MinifyPlugin ( { noMangling } ) . apply ( compiler )
1210+ new MinifyPlugin ( {
1211+ noMangling,
1212+ disableCharFreq : ! isClient ,
1213+ } ) . apply ( compiler )
12111214 } ,
12121215 // Minify CSS
12131216 ( compiler : webpack . Compiler ) => {
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ function buildError(error: any, file: string) {
3232const debugMinify = process . env . NEXT_DEBUG_MINIFY
3333
3434export class MinifyPlugin {
35- constructor ( private options : { noMangling ?: boolean } ) { }
35+ constructor (
36+ private options : { noMangling ?: boolean ; disableCharFreq ?: boolean }
37+ ) { }
3638
3739 async optimize (
3840 compiler : any ,
@@ -47,7 +49,11 @@ export class MinifyPlugin {
4749 RawSource : typeof sources . RawSource
4850 }
4951 ) {
50- const mangle = ! this . options . noMangling
52+ const mangle = this . options . noMangling
53+ ? false
54+ : {
55+ disableCharFreq : ! ! this . options . disableCharFreq ,
56+ }
5157 const compilationSpan =
5258 getCompilationSpan ( compilation ) ! || getCompilationSpan ( compiler )
5359
You can’t perform that action at this time.
0 commit comments