mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-25 12:15:18 +01:00
split angular into its own chunk
This commit is contained in:
parent
2e346dbe2f
commit
5994637522
@ -75,7 +75,7 @@ const plugins = [
|
||||
new HtmlWebpackPlugin({
|
||||
template: './src/popup/index.html',
|
||||
filename: 'popup/index.html',
|
||||
chunks: ['popup/vendor', 'popup/main'],
|
||||
chunks: ['popup/vendor-angular', 'popup/vendor', 'popup/main'],
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
template: './src/background.html',
|
||||
@ -144,12 +144,26 @@ const config = {
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
commons: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
test(module, chunks) {
|
||||
return module.resource != null &&
|
||||
module.resource.includes(`${path.sep}node_modules${path.sep}`) &&
|
||||
!module.resource.includes(`${path.sep}node_modules${path.sep}@angular${path.sep}`);
|
||||
},
|
||||
name: 'popup/vendor',
|
||||
chunks: (chunk) => {
|
||||
return chunk.name === 'popup/main';
|
||||
},
|
||||
},
|
||||
angular: {
|
||||
test(module, chunks) {
|
||||
return module.resource != null &&
|
||||
module.resource.includes(`${path.sep}node_modules${path.sep}@angular${path.sep}`);
|
||||
},
|
||||
name: 'popup/vendor-angular',
|
||||
chunks: (chunk) => {
|
||||
return chunk.name === 'popup/main';
|
||||
},
|
||||
},
|
||||
commons2: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
name: 'vendor',
|
||||
|
Loading…
Reference in New Issue
Block a user