mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-24 06:35:10 +00:00
27 lines
794 B
JavaScript
27 lines
794 B
JavaScript
'use strict'
|
|
|
|
import { defaults } from 'lodash'
|
|
|
|
export default function ({ isClient }) {
|
|
let babelOptions = JSON.stringify(defaults(this.options.build.babel, {
|
|
presets: ['vue-app'],
|
|
babelrc: false,
|
|
cacheDirectory: !!this.dev
|
|
}))
|
|
let config = {
|
|
postcss: this.options.build.postcss,
|
|
loaders: {
|
|
'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
|
|
}
|
|
// Return the config
|
|
return config
|
|
}
|