Skip to content

Commit

Permalink
Disable solid-refresh transform during SSR
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nksaraf authored Jan 13, 2022
1 parent 1494e5d commit 97debbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export default function solidPlugin(options: Partial<Options> = {}): 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,
Expand Down

0 comments on commit 97debbe

Please sign in to comment.