diff --git a/packages/vite-node/src/client.ts b/packages/vite-node/src/client.ts index 00a2e1176271..24a314c6da2e 100644 --- a/packages/vite-node/src/client.ts +++ b/packages/vite-node/src/client.ts @@ -323,6 +323,9 @@ export class ViteNodeRunner { hotContext ||= this.options.createHotContext?.(this, `/@fs/${fsPath}`) return hotContext }, + set: (value) => { + hotContext = value + }, }) } diff --git a/test/vite-node/src/deps.css b/test/vite-node/src/deps.css new file mode 100644 index 000000000000..293d3b1f1316 --- /dev/null +++ b/test/vite-node/src/deps.css @@ -0,0 +1,3 @@ +body { + margin: 0; +} diff --git a/test/vite-node/src/deps.ts b/test/vite-node/src/deps.ts index 285eb842f8ad..c81840a1d46e 100644 --- a/test/vite-node/src/deps.ts +++ b/test/vite-node/src/deps.ts @@ -1,3 +1,5 @@ +import './deps.css' + // eslint-disable-next-line no-console console.log('deps')