Skip to content

Commit af23df7

Browse files
antfuclaude
andauthored
fix(core): skip devtools injection for SSR builds (#291)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 05d618a commit af23df7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/src/node/plugins/injection.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ export function DevToolsInjection(): Plugin {
77
return {
88
name: 'vite:devtools:injection',
99
enforce: 'post',
10-
apply: 'serve',
10+
apply(_config, env) {
11+
return env.command === 'serve' && !env.isSsrBuild
12+
},
1113
transformIndexHtml() {
1214
const fileUrl = process.env.VITE_DEVTOOLS_LOCAL_DEV
1315
? normalize(join(dirDist, '..', 'src/client/inject/index.ts'))

0 commit comments

Comments
 (0)