mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-24 06:35:10 +00:00
16 lines
482 B
JavaScript
16 lines
482 B
JavaScript
|
import ExtractTextPlugin from 'extract-text-webpack-plugin'
|
||
|
|
||
|
export function extractStyles(ext) {
|
||
|
return !this.dev && !!this.options.build.extractCSS && this.options.build.extractCSS[ext] !== false
|
||
|
}
|
||
|
|
||
|
export function styleLoader(ext, loader = []) {
|
||
|
if (!extractStyles.call(this, ext)) {
|
||
|
return ['vue-style-loader', 'css-loader'].concat(loader)
|
||
|
}
|
||
|
return ExtractTextPlugin.extract({
|
||
|
use: ['css-loader?minimize'].concat(loader),
|
||
|
fallback: 'vue-style-loader'
|
||
|
})
|
||
|
}
|