Answer the question
In order to leave comments, you need to log in
Webpack how to pass variable to scss?
I use webpack.
module: {
loaders: [
{ test: /\.scss$/, loader: ExtractTextPlugin.extract("style", "style!css?-minimize!sass?sourceMap")},
{ test: /\.jsx?$/, loader: 'jsx-loader?harmony' }
]
},
Answer the question
In order to leave comments, you need to log in
You can create 2 files with variables, put EnvironmentPlugin and import one or another file depending on the environment.
For example:
var vars = (NODE_ENV == 'prod') ? 'prod_vars' : 'dev_vars';
....
stylus: {
import: [' __dirname + '/commons/' + vars+'.styl', ']
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question