Skip to content

Commit 73a3d93

Browse files
committed
Add first load condition
1 parent 19282e1 commit 73a3d93

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/app/src/sandbox/eval/manager.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export default class Manager {
7979
hardReload: boolean;
8080
hmrStatus: 'idle' | 'check' | 'apply' | 'fail' | 'dispose' = 'idle';
8181
testRunner: TestRunner;
82+
isFirstLoad: boolean;
8283

8384
// List of modules that are being transpiled, to prevent duplicate jobs.
8485
transpileJobs: { [transpiledModuleId: string]: true };

packages/app/src/sandbox/eval/transpiled-module.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,11 @@ export default class TranspiledModule {
654654
: this.isEntry && !this.isTestFile;
655655

656656
if (shouldReloadPage) {
657-
ignoreNextCache();
657+
if (manager.isFirstLoad) {
658+
// We're in a reload loop! Ignore all caches!
659+
660+
ignoreNextCache();
661+
}
658662

659663
location.reload();
660664
return {};

0 commit comments

Comments
 (0)