Skip to content

Commit f530a72

Browse files
authored
fix(dev): make query selector regexes more inclusive (fix #19213) (#19767)
1 parent 8b3c76a commit f530a72

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/vite/src/node/plugins/css.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ const cssModuleRE = new RegExp(`\\.module${CSS_LANGS_RE.source}`)
228228
const directRequestRE = /[?&]direct\b/
229229
const htmlProxyRE = /[?&]html-proxy\b/
230230
const htmlProxyIndexRE = /&index=(\d+)/
231-
const commonjsProxyRE = /\?commonjs-proxy/
231+
const commonjsProxyRE = /[?&]commonjs-proxy/
232232
const inlineRE = /[?&]inline\b/
233233
const inlineCSSRE = /[?&]inline-css\b/
234234
const styleAttrRE = /[?&]style-attr\b/

packages/vite/src/node/plugins/html.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ interface ScriptAssetsUrl {
5050
}
5151

5252
const htmlProxyRE =
53-
/\?html-proxy=?(?:&inline-css)?(?:&style-attr)?&index=(\d+)\.(?:js|css)$/
54-
const isHtmlProxyRE = /\?html-proxy\b/
53+
/[?&]html-proxy=?(?:&inline-css)?(?:&style-attr)?&index=(\d+)\.(?:js|css)$/
54+
const isHtmlProxyRE = /[?&]html-proxy\b/
5555

5656
const inlineCSSRE = /__VITE_INLINE_CSS__([a-z\d]{8}_\d+)__/g
5757
// Do not allow preceding '.', but do allow preceding '...' for spread operations

0 commit comments

Comments
 (0)