enable code splitting and add chunk names to dynamic import and create separate chunk vendor for all node modules (#2245)
* build: increase Limit chunk to enable code splitting add chunk names to dynamic import * Remove limitchunkcount and have separate chunk for each node module so we dnt have any unnamed id.js chunks * fix * create one chunk for all node modules * Add caret to peer deps * extra space
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
const path = require("path");
|
||||
const webpack = require("webpack");
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
const TerserPlugin = require("terser-webpack-plugin");
|
||||
|
||||
@@ -76,10 +75,16 @@ module.exports = {
|
||||
new TerserPlugin({
|
||||
test: /\.js($|\?)/i,
|
||||
}),
|
||||
new webpack.optimize.LimitChunkCountPlugin({
|
||||
maxChunks: 1,
|
||||
}),
|
||||
],
|
||||
splitChunks: {
|
||||
chunks: "all",
|
||||
cacheGroups: {
|
||||
vendors: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
name: "vendor",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [new MiniCssExtractPlugin({ filename: "[name].css" })],
|
||||
externals: {
|
||||
|
||||
Reference in New Issue
Block a user