Browse Source

fix: merge common.js into common-ui.js

tophf 3 years ago
parent
commit
26f4c07384
1 changed files with 3 additions and 9 deletions
  1. 3 9
      scripts/plaid.conf.js

+ 3 - 9
scripts/plaid.conf.js

@@ -41,18 +41,12 @@ exports.optimization = {
         name: 'common-ui',
         name: 'common-ui',
         test: new RegExp([
         test: new RegExp([
           /\bsvg/,
           /\bsvg/,
-          'src/common/(ui|keyboard|load-script-icon)',
+          'src/common/',
           'node_modules/@violentmonkey/shortcut',
           'node_modules/@violentmonkey/shortcut',
           'node_modules/@?vue',
           'node_modules/@?vue',
         ].map(re => re.source || re).join('|').replace(/\\?\//g, '[/\\\\]')),
         ].map(re => re.source || re).join('|').replace(/\\?\//g, '[/\\\\]')),
-        chunks: 'all',
-        priority: 100,
-      },
-      common: {
-        name: 'common',
-        minChunks: 2,
-        enforce: true,
-        chunks: 'all',
+        /** Excluding the background entry because it uses only 4kB of common code */
+        chunks: c => c.name !== 'background/index',
       },
       },
       ...splitVendor('codemirror'),
       ...splitVendor('codemirror'),
       ...splitVendor('tldjs'),
       ...splitVendor('tldjs'),