feat: allow enfoce extract css in development

close #2002

BREAKING CHANGE: setting css.extract to true will now force extraction in development
This commit is contained in:
Evan You
2018-07-31 11:07:13 -04:00
parent d1a655c3f0
commit 686ec2591a
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -12,17 +12,17 @@ const findExisting = (context, files) => {
module.exports = (api, options) => {
api.chainWebpack(webpackConfig => {
const getAssetPath = require('../util/getAssetPath')
const shadowMode = !!process.env.VUE_CLI_CSS_SHADOW_MODE
const isProd = process.env.NODE_ENV === 'production'
const {
modules = false,
extract = true,
extract = isProd,
sourceMap = false,
loaderOptions = {}
} = options.css || {}
const shadowMode = !!process.env.VUE_CLI_CSS_SHADOW_MODE
const isProd = process.env.NODE_ENV === 'production'
const shouldExtract = isProd && extract !== false && !shadowMode
const shouldExtract = extract !== false && !shadowMode
const filename = getAssetPath(
options,
`css/[name]${options.filenameHashing ? '.[contenthash:8]' : ''}.css`,