Commit aadb61f0 by zhanghaozhe

全局注入公共scss变量

parent 40fce332
...@@ -110,6 +110,14 @@ module.exports = function(webpackEnv) { ...@@ -110,6 +110,14 @@ module.exports = function(webpackEnv) {
sourceMap: isEnvProduction && shouldUseSourceMap, sourceMap: isEnvProduction && shouldUseSourceMap,
}, },
}); });
if(preProcessor == 'sass-loader' && !cssOptions.modules){
loaders.push({
loader: require.resolve('sass-resources-loader'),
options: {
resources: [require.resolve('../src/styles/variable.scss')]
}
})
}
} }
return loaders; return loaders;
}; };
......
...@@ -133,7 +133,8 @@ ...@@ -133,7 +133,8 @@
] ]
}, },
"devDependencies": { "devDependencies": {
"babel-plugin-import": "^1.11.0" "babel-plugin-import": "^1.11.0",
"sass-resources-loader": "^2.0.0"
}, },
"theme": { "theme": {
"brand-primary": "green", "brand-primary": "green",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment