我在webpack配置中有以下配置用于拆分块。完美地创建了两个捆绑软件供应商(在初始文件中导入的节点模块)和common(在懒加载的组件中导入的节点模块)
splitChunks: {
name: true,cacheGroups: {
default: false,vendors: false,vendor: {
test: /[\\/]node_modules[\\/]/,name: "vendors",chunks: "initial"
},common: {
test: /[\\/]node_modules[\\/]/,name: "common",minChunks: 2,chunks: "async",priority: 10,reuseExistingChunk: true,enforce: true
}
}
},
问题-,但是有些节点模块不希望包含在任何捆绑软件中。以上两个包或主要包都不能单独创建。
import('lodash')
应该创建一个lodash.chunk.js。
import('underscore')
应该创建一个underscore.chunk.js。
我可以以为魔术评论吗? / * webpack忽略:true * /