Skip to content

Commit 7257fd8

Browse files
authored
fix: node platform for ssr dev regression (#8840)
1 parent cbefc63 commit 7257fd8

File tree

1 file changed

+1
-4
lines changed
  • packages/vite/src/node/optimizer

1 file changed

+1
-4
lines changed

packages/vite/src/node/optimizer/index.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -554,10 +554,7 @@ export async function runOptimizeDeps(
554554
// We can't use platform 'neutral', as esbuild has custom handling
555555
// when the platform is 'node' or 'browser' that can't be emulated
556556
// by using mainFields and conditions
557-
platform:
558-
config.build.ssr && config.ssr?.target !== 'webworker'
559-
? 'node'
560-
: 'browser',
557+
platform: ssr && config.ssr?.target !== 'webworker' ? 'node' : 'browser',
561558
define,
562559
format: 'esm',
563560
target: isBuild ? config.build.target || undefined : ESBUILD_MODULES_TARGET,

0 commit comments

Comments
 (0)