mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 17:37:14 +00:00
d4db5792a4
- Remove filenames.css - Add FriendlyErrorsWebpackPlugin() - Add sourceMaps for UglifyJS - Minify CSS for server-rendered pages - Add css-loader for imports
26 lines
774 B
JavaScript
26 lines
774 B
JavaScript
'use strict'
|
|
|
|
import { defaults } from 'lodash'
|
|
|
|
export default function ({ isClient }) {
|
|
let babelOptions = JSON.stringify(defaults(this.options.build.babel, {
|
|
presets: ['vue-app'],
|
|
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
|
|
}
|