请问有什么好的方式让umi2支持以模块化的形式编译node_modules下的less文件吗?
umi/packages/af-webpack/src/getWebpackConfig/css.js
Line 252 in 2620136
| | less: true, |
cig3rfwq1#
"umi": "2.9.6","af-webpack":"1.10.3","webpack-chain": "6.0.0",通过这样设置chainWebpack不生效:config.module.rule('less-in-node_modules').use('css-loader').tap((options, ...p) => {console.log('options', options);return Object.assign(options, {...options,modules: true,localIdentName:RELEASE_TAG === 'dev' ? '[name][local]_[hash:base64:5]' : '[hash:base64:5]',});});
1条答案
按热度按时间cig3rfwq1#
"umi": "2.9.6",
"af-webpack":"1.10.3",
"webpack-chain": "6.0.0",
通过这样设置chainWebpack不生效:
config.module
.rule('less-in-node_modules')
.use('css-loader')
.tap((options, ...p) => {
console.log('options', options);
return Object.assign(options, {
...options,
modules: true,
localIdentName:
RELEASE_TAG === 'dev' ? '[name][local]_[hash:base64:5]' : '[hash:base64:5]',
});
});