Skip to content

Commit

Permalink
fix: allow assigning new hotContext (#2524)
Browse files Browse the repository at this point in the history
* Allow assigning new hotContext

* fix lint

* add a regression case
  • Loading branch information
cometkim committed Dec 19, 2022
1 parent b8f34eb commit b4c43cd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/vite-node/src/client.ts
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
@@ -0,0 +1,3 @@
body {
margin: 0;
}
2 changes: 2 additions & 0 deletions test/vite-node/src/deps.ts
@@ -1,3 +1,5 @@
import './deps.css'

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

Expand Down

0 comments on commit b4c43cd

Please sign in to comment.