Prechádzať zdrojové kódy

chore: 修改TerserPlugin配置

xyh 2 rokov pred
rodič
commit
a2ea9a11e6
2 zmenil súbory, kde vykonal 4 pridanie a 31 odobranie
  1. 2 1
      .gitignore
  2. 2 30
      packages/webpack/config/optimization.js

+ 2 - 1
.gitignore

@@ -7,4 +7,5 @@ coverage
 cypress/videos
 cypress/screenshots
 lidao-wms
-.vscode/
+.vscode/
+*.zip

+ 2 - 30
packages/webpack/config/optimization.js

@@ -8,41 +8,13 @@ const optimization = {
   minimize: isProduction,
   minimizer: [
     new TerserPlugin({
+      extractComments: false,
       terserOptions: {
-        parse: {
-          // We want terser to parse ecma 8 code. However, we don't want it
-          // to apply any minification steps that turns valid ecma 5 code
-          // into invalid ecma 5 code. This is why the 'compress' and 'output'
-          // sections only apply transformations that are ecma 5 safe
-          // https://github.com/facebook/create-react-app/pull/4234
-          ecma: 8,
-        },
-        compress: {
-          ecma: 5,
-          warnings: false,
-          // Disabled because of an issue with Uglify breaking seemingly valid code:
-          // https://github.com/facebook/create-react-app/issues/2376
-          // Pending further investigation:
-          // https://github.com/mishoo/UglifyJS2/issues/2011
-          comparisons: false,
-          // Disabled because of an issue with Terser breaking valid code:
-          // https://github.com/facebook/create-react-app/issues/5250
-          // Pending further investigation:
-          // https://github.com/terser-js/terser/issues/120
-          inline: 2,
-        },
         mangle: {
           safari10: true,
         },
-        // Added for profiling in devtools
-        keep_classnames: isProduction,
-        keep_fnames: isProduction,
-        output: {
-          ecma: 5,
+        format: {
           comments: false,
-          // Turned on because emoji and regex is not minified properly using default
-          // https://github.com/facebook/create-react-app/issues/2488
-          ascii_only: true,
         },
       },
     }),