Nuxt/lib/webpack/vue-loader.config.js

26 lines
774 B
JavaScript
Raw Normal View History

'use strict'
2017-01-11 19:14:59 +00:00
import { defaults } from 'lodash'
2016-12-13 16:39:59 +00:00
2017-01-11 19:14:59 +00:00
export default function ({ isClient }) {
2016-12-13 16:39:59 +00:00
let babelOptions = JSON.stringify(defaults(this.options.build.babel, {
2017-02-17 15:13:51 +00:00
presets: ['vue-app'],
cacheDirectory: !!this.dev
2016-12-13 16:39:59 +00:00
}))
let config = {
2016-11-22 23:47:31 +00:00
postcss: this.options.build.postcss,
loaders: {
2016-12-13 16:37:53 +00:00
'js': 'babel-loader?' + babelOptions,
'css': 'vue-style-loader!css-loader',
'less': 'vue-style-loader!css-loader!less-loader',
'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax',
'scss': 'vue-style-loader!css-loader!sass-loader',
'stylus': 'vue-style-loader!css-loader!stylus-loader',
'styl': 'vue-style-loader!css-loader!stylus-loader'
},
preserveWhitespace: false
2016-11-07 01:34:58 +00:00
}
// Return the config
return config
2016-11-07 01:34:58 +00:00
}