Querify the Webpack Loader Configurations
This repository no more maintained. Please checkout webpack-combine-loaders.
{ test: /\.scss$/, loader: 'style!css?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded&sourceMap' }
var $q = require('webpack-querify');
...
{
test: /\.scss$/,
loader : $q({
style: {},
css: {
modules: true,
sourceMap: true,
importLoaders: 2,
localIdentName: '[local]___[hash:base64:5]'
},
autoprefixer: {
browsers: 'last 2 version'
},
sass: {
sourceMap: true,
outputStyle: 'expanded'
}
})
}
...
Some Webpack plugins like ExtractTextPlugin
only recieve loader configuration by string. Webpack Querify can be used in that case like below.
ExtractTextPlugin.extract(
'style',
$q({
css: {
modules: true,
importLoaders: 2,
sourceMap: true
},
sass: {
outputStyle: 'expanded',
sourceMap: true,
sourceMapContents: true
},
autoprefixer: {
browsers: 'last 4 version'
}
})
)