Skip to content

Commit e519cf2

Browse files
edi9999shellscape
authored andcommitted
Add feature to disable hotReloading with query string (#1068)
1 parent f166177 commit e519cf2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

client/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ function getCurrentScriptSource() {
2222
}
2323

2424
let urlParts;
25+
let hotReload = true;
26+
if (typeof window !== 'undefined') {
27+
const qs = window.location.search.toLowerCase();
28+
hotReload = qs.indexOf('hotreload=false') === -1;
29+
}
2530
if (typeof __resourceQuery === 'string' && __resourceQuery) {
2631
// If this bundle is inlined, use the resource query to get the correct url.
2732
urlParts = url.parse(__resourceQuery.substr(1));
@@ -192,7 +197,7 @@ self.addEventListener('beforeunload', () => {
192197
});
193198

194199
function reloadApp() {
195-
if (isUnloading) {
200+
if (isUnloading || !hotReload) {
196201
return;
197202
}
198203
if (hot) {

0 commit comments

Comments
 (0)