From 59bc4037e798a8b14db19a7402348596c0750ea9 Mon Sep 17 00:00:00 2001 From: Eric Chen Date: Wed, 1 Sep 2021 11:03:46 +0800 Subject: [PATCH] fix(pitcher): css-loader >= v4 compat --- lib/codegen/styleInjection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/codegen/styleInjection.js b/lib/codegen/styleInjection.js index 9a8cfc99a..c8e65182c 100644 --- a/lib/codegen/styleInjection.js +++ b/lib/codegen/styleInjection.js @@ -40,7 +40,7 @@ module.exports = function genStyleInjectionCode ( // `(vue-)style-loader` exports the name-to-hash map directly // `css-loader` exports it in `.locals` - const locals = `(style${i}.locals || style${i})` + const locals = `(style${i}.default || style${i}.locals || style${i})` const name = JSON.stringify(moduleName) if (!needsHotReload) { @@ -81,7 +81,7 @@ module.exports = function genStyleInjectionCode ( // do not generate requests for empty styles if (isNotEmptyStyle(style)) { const request = genStyleRequest(style, i) - styleImportsCode += `import style${i} from ${request}\n` + styleImportsCode += `import * as style${i} from ${request}\n` if (style.module) genCSSModulesCode(style, request, i) } })