Nuxt/lib/webpack/helpers.js
2017-05-05 17:53:21 +02:00

16 lines
431 B
JavaScript
Executable File

import ExtractTextPlugin from 'extract-text-webpack-plugin'
export function extractStyles () {
return !this.dev && this.options.build.extractCSS
}
export function styleLoader (ext, loader = []) {
if (extractStyles.call(this)) {
return ExtractTextPlugin.extract({
use: ['css-loader?minimize'].concat(loader),
fallback: 'vue-style-loader'
})
}
return ['vue-style-loader', 'css-loader'].concat(loader)
}