Webpack update for fixing Gutenberg translations.
This commit is contained in:
parent
e500e44eb4
commit
ebc7f73e27
|
@ -110,7 +110,7 @@ module.exports = {
|
|||
};
|
||||
|
||||
// Change to true for production mode
|
||||
const production = false;
|
||||
const production = true;
|
||||
|
||||
if (production === true) {
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
|
@ -129,7 +129,18 @@ if (production === true) {
|
|||
}),
|
||||
new TerserPlugin({
|
||||
parallel: true,
|
||||
sourceMap: false
|
||||
sourceMap: false,
|
||||
cache: true,
|
||||
terserOptions: {
|
||||
// We preserve function names that start with capital letters as
|
||||
// they're _likely_ component names, and these are useful to have
|
||||
// in tracebacks and error messages.
|
||||
keep_fnames: /__|_x|_n|_nx|sprintf|^[A-Z].+$/,
|
||||
output: {
|
||||
comments: /translators:/i,
|
||||
},
|
||||
},
|
||||
extractComments: false,
|
||||
}),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
minimize: true
|
||||
|
|
Loading…
Reference in New Issue