output: {
path: path.join(__dirname, '/dist'),
filename: pkg.name + 'js,
library: pkg.name,
libraryTarget: 'umd',
umdNamedDefine: true,
},
splitChunks: {
chunks: 'all',
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name(module) {
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
return `vendor-${packageName.replace('@', '')}`;
},
},
app: {
name: 'app',
enforce: true,
maxSize: 249856,
chunks: 'all',
},
},
},