Skip to content

Commit 364ad09

Browse files
committed
fix: always pass id to stylePostLoader when possible
for css v-bind compilation
1 parent bfddeb6 commit 364ad09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: lib/codegen/styleInjection.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ module.exports = function genStyleInjectionCode(
2323
const src = style.src || resourcePath
2424
const attrsQuery = attrsToQuery(style.attrs, 'css')
2525
const inheritQuery = `&${loaderContext.resourceQuery.slice(1)}`
26-
// make sure to only pass id when necessary so that we don't inject
26+
// make sure to only pass id not src importing so that we don't inject
2727
// duplicate tags when multiple components import the same css file
28-
const idQuery = style.scoped ? `&id=${id}` : ``
28+
const idQuery = !style.src || style.scoped ? `&id=${id}` : ``
2929
const prodQuery = isProduction ? `&prod` : ``
3030
const query = `?vue&type=style&index=${i}${idQuery}${prodQuery}${attrsQuery}${inheritQuery}`
3131
return stringifyRequest(src + query)

0 commit comments

Comments
 (0)