Skip to content

Commit

Permalink
Add feature to disable hotReloading with query string
Browse files Browse the repository at this point in the history
  • Loading branch information
edi9999 committed Sep 12, 2017
1 parent f00fcb3 commit 62b199c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ function getCurrentScriptSource() {
}

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

function reloadApp() {
if (isUnloading) {
if (isUnloading || !hotReload) {
return;
}
if (hot) {
Expand Down

0 comments on commit 62b199c

Please sign in to comment.