2017-08-21 11:16:35 +00:00
|
|
|
export default function vueLoader () {
|
2017-08-14 14:03:07 +00:00
|
|
|
// https://vue-loader.vuejs.org/en
|
2017-06-15 22:19:53 +00:00
|
|
|
const config = {
|
2016-11-22 23:47:31 +00:00
|
|
|
postcss: this.options.build.postcss,
|
2017-08-14 14:03:07 +00:00
|
|
|
extractCSS: this.options.build.extractCSS,
|
|
|
|
cssSourceMap: this.options.build.cssSourceMap,
|
|
|
|
preserveWhitespace: false,
|
2016-11-09 22:59:41 +00:00
|
|
|
loaders: {
|
2017-08-14 14:03:07 +00:00
|
|
|
'js': {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: Object.assign({}, this.babelOptions)
|
|
|
|
},
|
|
|
|
// Note: do not nest the `postcss` option under `loaders`
|
|
|
|
'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),
|
|
|
|
'stylus': this.styleLoader('stylus', 'stylus-loader', true),
|
|
|
|
'styl': this.styleLoader('stylus', 'stylus-loader', true)
|
2016-12-20 10:58:32 +00:00
|
|
|
},
|
2017-08-13 09:00:05 +00:00
|
|
|
template: {
|
2017-08-14 14:03:07 +00:00
|
|
|
doctype: 'html' // For pug, see https://github.com/vuejs/vue-loader/issues/55
|
|
|
|
}
|
2016-11-07 01:34:58 +00:00
|
|
|
}
|
2017-06-15 22:19:53 +00:00
|
|
|
|
2016-11-09 22:59:41 +00:00
|
|
|
// Return the config
|
|
|
|
return config
|
2016-11-07 01:34:58 +00:00
|
|
|
}
|