mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
feat: make extractCSS configurable
This commit is contained in:
parent
a7a5aea003
commit
ff4a5bd404
@ -105,10 +105,13 @@ export default function webpackBaseConfig(name) {
|
||||
}
|
||||
|
||||
// CSS extraction
|
||||
if (this.options.build.extractCSS) {
|
||||
config.plugins.push(new ExtractTextPlugin({
|
||||
filename: this.options.build.filenames.css
|
||||
}))
|
||||
const extractCSS = this.options.build.extractCSS
|
||||
if (extractCSS) {
|
||||
const extractOptions = Object.assign(
|
||||
{ filename: this.options.build.filenames.css },
|
||||
typeof extractCSS === 'object' ? extractCSS : {}
|
||||
)
|
||||
config.plugins.push(new ExtractTextPlugin(extractOptions))
|
||||
}
|
||||
|
||||
// Workaround for hiding Warnings about plugins without a default export (#1179)
|
||||
|
@ -2,7 +2,7 @@ export default function vueLoader() {
|
||||
// https://vue-loader.vuejs.org/en
|
||||
const config = {
|
||||
postcss: this.options.build.postcss,
|
||||
extractCSS: this.options.build.extractCSS,
|
||||
extractCSS: !!this.options.build.extractCSS,
|
||||
cssSourceMap: this.options.build.cssSourceMap,
|
||||
preserveWhitespace: false,
|
||||
loaders: {
|
||||
|
Loading…
Reference in New Issue
Block a user