Preserve webpack/vite ignore comments when minifying
They were removed in the minified build, but the code that made the comments necessary was still there (just minified). This commit updates the Terser config to preserve them.
The default value of Terser's `comments` option is [`/@preserve|@copyright|@lic|@cc_on|^\**!/i`](d528103b7c/lib/output.js (L178C12-L178C53)), however the only type of comment it was actually matching in our case is `@lic`, for the license header in minified files. Thus the new regexp is `/@lic|webpackIgnore|@vite-ignore/i`.
This commit is contained in:
parent
3f1ecc1ba9
commit
ff432c39f9
@ -362,6 +362,9 @@ function createWebpackConfig(
|
||||
// V8 chokes on very long sequences, work around that.
|
||||
sequences: false,
|
||||
},
|
||||
format: {
|
||||
comments: /@lic|webpackIgnore|@vite-ignore/i,
|
||||
},
|
||||
keep_classnames: true,
|
||||
keep_fnames: true,
|
||||
module: isModule,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user