Skip to content

Commit b4c43cd

Browse files
authoredDec 19, 2022
fix: allow assigning new hotContext (#2524)
* Allow assigning new hotContext * fix lint * add a regression case
1 parent b8f34eb commit b4c43cd

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed
 

‎packages/vite-node/src/client.ts

+3
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ export class ViteNodeRunner {
323323
hotContext ||= this.options.createHotContext?.(this, `/@fs/${fsPath}`)
324324
return hotContext
325325
},
326+
set: (value) => {
327+
hotContext = value
328+
},
326329
})
327330
}
328331

‎test/vite-node/src/deps.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
margin: 0;
3+
}

‎test/vite-node/src/deps.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import './deps.css'
2+
13
// eslint-disable-next-line no-console
24
console.log('deps')
35

0 commit comments

Comments
 (0)
Please sign in to comment.