diff --git a/lib/builder/webpack/base.config.js b/lib/builder/webpack/base.config.js index 8072e0ff09..987e32acb7 100644 --- a/lib/builder/webpack/base.config.js +++ b/lib/builder/webpack/base.config.js @@ -109,10 +109,13 @@ export default function webpackBaseConfig(name) { config.plugins.unshift(new TimeFixPlugin()) // 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) diff --git a/lib/builder/webpack/vue-loader.config.js b/lib/builder/webpack/vue-loader.config.js index f281c06fe1..72f431f5c0 100644 --- a/lib/builder/webpack/vue-loader.config.js +++ b/lib/builder/webpack/vue-loader.config.js @@ -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: {