From 408367d96d4557fe6cac5d4970290a9b8d362372 Mon Sep 17 00:00:00 2001 From: "Alexis H. Munsayac" Date: Sun, 16 Jan 2022 21:04:38 +0800 Subject: [PATCH] Fix #26 --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 1d022ae..9446759 100644 --- a/src/index.ts +++ b/src/index.ts @@ -290,7 +290,7 @@ export default function solidPlugin(options: Partial = {}): Plugin { }, configResolved(config) { - needHmr = config.command === 'serve' && !config.isProduction && options.hot !== false; + needHmr = config.command === 'serve' && config.mode !== 'production' && options.hot !== false; }, resolveId(id) { @@ -336,7 +336,7 @@ export default function solidPlugin(options: Partial = {}): Plugin { filename: id, sourceFileName: id, presets: [[solid, { ...solidOptions, ...(options.solid || {}) }]], - plugins: needHmr && !isSsr && !inNodeModules ? [[solidRefresh, { bundler: 'vite' }]] : undefined, + plugins: needHmr && !isSsr && !inNodeModules ? [[solidRefresh, { bundler: 'vite' }]] : [], sourceMaps: true, // Vite handles sourcemap flattening inputSourceMap: false as any,