Nuxt/lib/webpack/helpers.js

16 lines
431 B
JavaScript
Raw Normal View History

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