chore: add support for HMR env flag

pull/12420/head
Dominic Gannaway 2 years ago
parent 5684a181da
commit 36e4c3ef7c

@ -141,17 +141,14 @@ async function common_setup(cwd: string, runes: boolean | undefined, config: Run
const compileOptions: CompileOptions = { const compileOptions: CompileOptions = {
generate: 'client', generate: 'client',
rootDir: cwd, rootDir: cwd,
dev: process.env.HMR ? true : undefined,
hmr: process.env.HMR ? true : undefined,
...config.compileOptions, ...config.compileOptions,
immutable: config.immutable, immutable: config.immutable,
accessors: 'accessors' in config ? config.accessors : true, accessors: 'accessors' in config ? config.accessors : true,
runes runes
}; };
if (process.env.HMR && compileOptions.dev !== false) {
compileOptions.dev = true;
compileOptions.hmr = true;
}
// load_compiled can be used for debugging a test. It means the compiler will not run on the input // load_compiled can be used for debugging a test. It means the compiler will not run on the input
// so you can manipulate the output manually to see what fixes it, adding console.logs etc. // so you can manipulate the output manually to see what fixes it, adding console.logs etc.
if (!config.load_compiled) { if (!config.load_compiled) {

Loading…
Cancel
Save