fix sass loader with indentedSyntax

fixes #1436

query options cannot be used when options provided
This commit is contained in:
Pooya Parsa 2017-08-22 00:38:39 +04:30
parent 0795d40bb7
commit b931dd40ce
3 changed files with 8 additions and 9 deletions

View File

@ -74,7 +74,7 @@ export default function webpackBaseConfig (name) {
},
{ test: /\.css$/, use: this.styleLoader('css') },
{ test: /\.less$/, use: this.styleLoader('less', 'less-loader') },
{ test: /\.sass$/, use: this.styleLoader('sass', 'sass-loader?indentedSyntax') },
{ test: /\.sass$/, use: this.styleLoader('sass', {loader: 'sass-loader', options: { indentedSyntax: true }}) },
{ test: /\.scss$/, use: this.styleLoader('scss', 'sass-loader') },
{ test: /\.styl(us)?$/, use: this.styleLoader('stylus', 'stylus-loader') },
{

View File

@ -5,14 +5,13 @@ export default function styleLoader (ext, loaders = [], isVueLoader = false) {
// Normalize loaders
loaders = (Array.isArray(loaders) ? loaders : [loaders]).map(loader => {
if (typeof loader === 'string') {
return {
loader,
loader = { loader }
}
return Object.assign({
options: {
sourceMap: this.options.build.cssSourceMap
}
}
}
return loader
}, loader)
})
// https://github.com/postcss/postcss-loader

View File

@ -14,7 +14,7 @@ export default function vueLoader () {
'css': this.styleLoader('css', [], true),
'less': this.styleLoader('less', 'less-loader', true),
'scss': this.styleLoader('scss', 'sass-loader', true),
'sass': this.styleLoader('sass', 'sass-loader?indentedSyntax', true),
'sass': this.styleLoader('sass', {loader: 'sass-loader', options: { indentedSyntax: true }}, true),
'stylus': this.styleLoader('stylus', 'stylus-loader', true),
'styl': this.styleLoader('stylus', 'stylus-loader', true)
},