Skip to content

Commit

Permalink
fix(pitcher): css-loader >= v4 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Airkro committed Sep 1, 2021
1 parent 4240e5b commit 59bc403
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/codegen/styleInjection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
}
})
Expand Down

0 comments on commit 59bc403

Please sign in to comment.