Skip to content

Commit fffd2f8

Browse files
authored
fix: should check http url using link.href for extract-css runtime (#11547)
fix: should check http url using `link.href` for extract-css runtime, css update using
1 parent eccc5b2 commit fffd2f8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/rspack-test-tools/tests/hotCases/css/recovery/__snapshots__/web/2.snap.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
## Asset Files
77
- Bundle: bundle.js
88
- Manifest: main.LAST_HASH.hot-update.json, size: 28
9-
- Update: main.hot-update.js, size: 7153
9+
- Update: main.hot-update.js, size: 7147
1010

1111
## Manifest
1212

@@ -84,7 +84,7 @@ function updateCss(el, url) {
8484
if (!href) return;
8585
normalizedUrl = href.split("?")[0];
8686
}
87-
if (!isUrlRequest(normalizedUrl) || !1 === el.isLoaded || !normalizedUrl || !(normalizedUrl.indexOf(".css") > -1)) return;
87+
if (!isUrlRequest(el.href) || !1 === el.isLoaded || !normalizedUrl || !(normalizedUrl.indexOf(".css") > -1)) return;
8888
el.visited = !0;
8989
let newEl = el.cloneNode();
9090
newEl.isLoaded = !1, newEl.addEventListener("load", ()=>{

packages/rspack/src/runtime/cssExtractHmr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function updateCss(el: HTMLLinkElement & Record<string, any>, url?: string) {
119119
normalizedUrl = url;
120120
}
121121

122-
if (!isUrlRequest(normalizedUrl)) {
122+
if (!isUrlRequest(el.href)) {
123123
return;
124124
}
125125

0 commit comments

Comments
 (0)