Skip to content

Commit 36e4c3e

Browse files
committed
chore: add support for HMR env flag
1 parent 5684a18 commit 36e4c3e

File tree

1 file changed

+2
-5
lines changed
  • packages/svelte/tests/runtime-legacy

1 file changed

+2
-5
lines changed

packages/svelte/tests/runtime-legacy/shared.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,14 @@ async function common_setup(cwd: string, runes: boolean | undefined, config: Run
141141
const compileOptions: CompileOptions = {
142142
generate: 'client',
143143
rootDir: cwd,
144+
dev: process.env.HMR ? true : undefined,
145+
hmr: process.env.HMR ? true : undefined,
144146
...config.compileOptions,
145147
immutable: config.immutable,
146148
accessors: 'accessors' in config ? config.accessors : true,
147149
runes
148150
};
149151

150-
if (process.env.HMR && compileOptions.dev !== false) {
151-
compileOptions.dev = true;
152-
compileOptions.hmr = true;
153-
}
154-
155152
// load_compiled can be used for debugging a test. It means the compiler will not run on the input
156153
// so you can manipulate the output manually to see what fixes it, adding console.logs etc.
157154
if (!config.load_compiled) {

0 commit comments

Comments
 (0)