Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow assigning new hotContext #2524

Merged
merged 3 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/vite-node/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@ export class ViteNodeRunner {
hotContext ||= this.options.createHotContext?.(this, `/@fs/${fsPath}`)
return hotContext
},
set: (value) => {
hotContext = value
},
})
}

Expand Down
3 changes: 3 additions & 0 deletions test/vite-node/src/deps.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
margin: 0;
}
2 changes: 2 additions & 0 deletions test/vite-node/src/deps.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import './deps.css'

// eslint-disable-next-line no-console
console.log('deps')

Expand Down