vue-cli-plugin-browser-extension icon indicating copy to clipboard operation
vue-cli-plugin-browser-extension copied to clipboard

how to support common chunk (vendor) for background/popup/content/pages

Open ipluser opened this issue 5 years ago • 1 comments

The google extension has multiple content entries and customization pages, it also has a popup and background script. So the output size is too large, I want to split chunks to reduce size of the bundle script, then I adjust vue.config.js:

configureWebpack: {
    optimization: {
      splitChunks: {
        cacheGroups: {
          vendors: {
            test: /[\\/]node_modules[\\/]/,
            name: 'vendors',
            chunks: 'all'
          }
        }
      }
    }
  },
  pages: {
    'popup/popup': {
      entry: 'src/popup/popup.js',
      title: 'Shop Eden',
      chunks: ['vendors', 'popup/popup']
    }
 }

Then the pages, popup scripts is ok, but the background and content scripts doesn't work, How to support split chunks feature for all scripts? (only chainWebpack?)

ipluser avatar Jan 19 '20 09:01 ipluser

哥,这问题解决了嘛?

Yangjia23 avatar Dec 13 '21 12:12 Yangjia23