|
@@ -38,4 +38,18 @@ module.exports = {
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
+ chainWebpack: config => {
|
|
|
+ const types = ['vue-modules', 'vue', 'normal-modules', 'normal'];
|
|
|
+ types.forEach(type => addStyleResource(config.module.rule('less').oneOf(type)));
|
|
|
+ },
|
|
|
};
|
|
|
+function addStyleResource(rule) {
|
|
|
+ rule
|
|
|
+ .use('style-resource')
|
|
|
+ .loader('style-resources-loader')
|
|
|
+ .options({
|
|
|
+ patterns: [
|
|
|
+ path.resolve(__dirname, './src/style/color.less'), // 需要全局导入的less
|
|
|
+ ],
|
|
|
+ });
|
|
|
+}
|