From 97debbe5f820de1112f37a323ba420d9af8449a5 Mon Sep 17 00:00:00 2001 From: Nikhil Saraf Date: Thu, 13 Jan 2022 00:33:46 -0800 Subject: [PATCH] Disable solid-refresh transform during SSR We don't need the solid-refresh transform during SSR and it could cause issues. Better to disable it. During SSR, the HMR is handled at the module level by Vite itself --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 67146d6..b85d4cb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -336,7 +336,7 @@ export default function solidPlugin(options: Partial = {}): Plugin { filename: id, sourceFileName: id, presets: [[solid, { ...solidOptions, ...(options.solid || {}) }]], - plugins: needHmr && !inNodeModules ? [[solidRefresh, { bundler: 'vite' }]] : [], + plugins: needHmr && !isSsr && !inNodeModules ? [[solidRefresh, { bundler: 'vite' }]] : [], sourceMaps: true, // Vite handles sourcemap flattening inputSourceMap: false as any,