Browse Source

Do not quote properties when optimizing bundles

Signed-off-by: Julius Härtl <jus@bitgrid.net>
Julius Härtl 3 năm trước cách đây
mục cha
commit
5aef97cfa7
1 tập tin đã thay đổi với 14 bổ sung0 xóa
  1. 14 0
      webpack.prod.js

+ 14 - 0
webpack.prod.js

@@ -1,9 +1,23 @@
 const merge = require('webpack-merge')
 const common = require('./webpack.common.js')
+const TerserPlugin = require('terser-webpack-plugin');
 
 module.exports = common.map(
 	config => merge(config, {
 		mode: 'production',
 		devtool: '#source-map',
+		// This is required to keep IE11 compatibility (see #21316)
+		optimization: {
+			minimize: true,
+			minimizer: [
+				new TerserPlugin({
+					terserOptions: {
+						output: {
+							keep_quoted_props: true,
+						},
+					},
+				}),
+			],
+		},
 	})
 )