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

lib/codegen/styleInjection.js

Lines changed: 2 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy