Skip to content

Commit 4de8eef

Browse files
committed
Fix: CSS HMR interfered with 3-rd party CSS imports via HTML tags
Fix for topcoder-archive/topcoder_platform-topcoder-react-starter#2
1 parent def498c commit 4de8eef

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/client/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ export default async function Launch({
5555
const stamp = shortId();
5656
const links = document.querySelectorAll('link[rel=stylesheet]');
5757
for (let i = 0; i < links.length; i += 1) {
58-
links[i].href = `${links[i].href.match(/[^?]*/)}?v=${stamp}`;
58+
const link = links[i];
59+
if (link.href.startsWith('/')) {
60+
link.href = `${link.href.match(/[^?]*/)}?v=${stamp}`;
61+
}
5962
}
6063
hotSuccess();
6164
};

0 commit comments

Comments
 (0)