Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 546b7a8

Browse files
committed
Improve RE_REACT_URL
1 parent fb527f9 commit 546b7a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/resolver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ lazy_static! {
2121
r"^https?://deno.land/x/aleph(@v?[0-9a-z\.\-]+)?/"
2222
).unwrap();
2323
pub static ref RE_REACT_URL: Regex = Regex::new(
24-
r"^https?://(esm.sh|cdn.esm.sh|cdn.esm.sh.cn|esm.x-static.io)(/v\d+)?/react(\-dom)?(@[\^|~]{0,1}[0-9a-z\.\-]+)?([/|\?].*)?$"
24+
r"^https?://(esm\.sh|cdn\.esm\.sh|esm\.x-static\.io)(/v\d+)?/react(\-dom)?(@[^/]+)?(/.*)?$"
2525
)
2626
.unwrap();
2727
}
@@ -297,7 +297,7 @@ impl Resolver {
297297
("".to_owned(), false)
298298
};
299299
let non_esm_sh_cdn = match host {
300-
"esm.sh" | "cdn.esm.sh" | "cdn.esm.sh.cn" | "esm.x-static.io" => false,
300+
"esm.sh" | "cdn.esm.sh" | "esm.x-static.io" => false,
301301
_ => true,
302302
};
303303
if non_esm_sh_cdn {

0 commit comments

Comments
 (0)