mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 16:43:55 +00:00
87172100c7
This option is disabled by default and won't affect exiting users. However users can easily enable this option using `nuxt.build.extractCSS` Implementation is according to: - https://github.com/vuejs/vue-loader/tree/master/docs/en/configurations - https://ssr.vuejs.org/en/css.html - https://github.com/vuejs/vue-hackernews-2.0/tree/master/build
16 lines
482 B
JavaScript
Executable File
16 lines
482 B
JavaScript
Executable File
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'
|
|
})
|
|
}
|