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