Skip to content

Commit ee5a513

Browse files
committed
test(rsc): test module runner hmr: false
1 parent a6e1cca commit ee5a513

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

packages/plugin-rsc/examples/basic/vite.config.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ import assert from 'node:assert'
22
import rsc, { transformHoistInlineDirective } from '@vitejs/plugin-rsc'
33
import tailwindcss from '@tailwindcss/vite'
44
import react from '@vitejs/plugin-react'
5-
import { type Plugin, defineConfig, normalizePath, parseAstAsync } from 'vite'
5+
import {
6+
type Plugin,
7+
createRunnableDevEnvironment,
8+
defineConfig,
9+
normalizePath,
10+
parseAstAsync,
11+
} from 'vite'
612
import inspect from 'vite-plugin-inspect'
713
import path from 'node:path'
814

@@ -157,6 +163,30 @@ export default { fetch: handler };
157163
'@vitejs/test-dep-server-in-client/client',
158164
],
159165
},
166+
environments: {
167+
ssr: {
168+
dev: {
169+
createEnvironment(name, config) {
170+
return createRunnableDevEnvironment(name, config, {
171+
runnerOptions: {
172+
hmr: false,
173+
},
174+
})
175+
},
176+
},
177+
},
178+
rsc: {
179+
dev: {
180+
createEnvironment(name, config) {
181+
return createRunnableDevEnvironment(name, config, {
182+
runnerOptions: {
183+
hmr: false,
184+
},
185+
})
186+
},
187+
},
188+
},
189+
},
160190
}) as any
161191

162192
function vitePluginUseCache(): Plugin[] {

0 commit comments

Comments
 (0)