Skip to content

Commit 408367d

Browse files
authored
Fix #26
1 parent 84c2568 commit 408367d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export default function solidPlugin(options: Partial<Options> = {}): Plugin {
290290
},
291291

292292
configResolved(config) {
293-
needHmr = config.command === 'serve' && !config.isProduction && options.hot !== false;
293+
needHmr = config.command === 'serve' && config.mode !== 'production' && options.hot !== false;
294294
},
295295

296296
resolveId(id) {
@@ -336,7 +336,7 @@ export default function solidPlugin(options: Partial<Options> = {}): Plugin {
336336
filename: id,
337337
sourceFileName: id,
338338
presets: [[solid, { ...solidOptions, ...(options.solid || {}) }]],
339-
plugins: needHmr && !isSsr && !inNodeModules ? [[solidRefresh, { bundler: 'vite' }]] : undefined,
339+
plugins: needHmr && !isSsr && !inNodeModules ? [[solidRefresh, { bundler: 'vite' }]] : [],
340340
sourceMaps: true,
341341
// Vite handles sourcemap flattening
342342
inputSourceMap: false as any,

0 commit comments

Comments
 (0)