Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
sibbng committed Dec 2, 2022
1 parent 836857f commit 0bcdd01
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/vite/src/modes/shadow-dom.ts
Expand Up @@ -100,6 +100,8 @@ export function ShadowDomModuleModePlugin({ uno }: UnocssPluginContext): Plugin
}
}

// We don't need to escape backslashes here, because, unlike the other
// shadow-dom targets, style block in Vue SFC is not a string literal.
if (id.includes('?vue&type=style') || (id.endsWith('.vue') && vueSFCStyleRE.test(code)))
return code.replace(new RegExp(`(\\/\\*\\s*)?${CSS_PLACEHOLDER}(\\s*\\*\\/)?`), css || '')

Expand Down

0 comments on commit 0bcdd01

Please sign in to comment.