vue-cli-plugin-browser-extension
vue-cli-plugin-browser-extension copied to clipboard
how to support common chunk (vendor) for background/popup/content/pages
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?)
哥,这问题解决了嘛?