Closed flicker85 closed 7 years ago
还有,如果想把打包出的js文件中重复的Menu组件代码也提取出来应该怎么写? 以前在webpack中是使用CommonsChunkPlugin提取。
已解决
@flicker85 可以说一下解决方法吗?目前也想使用这种方法
@zhangjingge https://github.com/sorrycc/roadhog
module.exports = function (webpackConfig, env) {
if (env === 'production') {
webpackConfig.plugins.forEach(plugin => {
if(plugin.filename && plugin.filename === "[name].css") {
plugin.options && (plugin.options.allChunks = true);
}
});
}
return webpackConfig;
}
@flicker85 灰常感谢
执行build,indexPage和Users打包出的js文件中存在大量的 .ant-menu-... 等样式代码,请问如何把这些重复的代码提取到index.css中? 以前在webpack中是用ExtractTextPlugin提取,请问在dva roadhog中应该怎么配置?