我目前正在使用带有 react loadable 的 webpack 4 来创建块。它实际上块取决于断点。但是,供应商规模保持不变。React loadable 还不支持 webpack 4 吗?或者我缺少一些设置?
CSS实际上似乎被分成了块,虽然
{
output: {
path: 'tothe path',
publicPath: `/publicPath/`,
filename: '[name] + '.js',
chunkFilename: '[name]',
},
resolve: {
extensions: ['.js', '.json', '.css'],
alias: aliases
},
stats: {
warnings: false,
children: false,
},
optimization: {
splitChunks: {
chunks: "all",
name: true,
cacheGroups: {
common: {
name: "vendor" + ".js",
test: /[\\/]node_modules[\\/]/,
chunks: "all",
enforce: true,
reuseExistingChunk: false,
},
}
}
}
}