Skip to content

Commit 7cb8db2

Browse files
committed
feat: add hmr hot getExports
1 parent 4a45254 commit 7cb8db2

File tree

1 file changed

+9
-0
lines changed
  • packages/vite/src/shared

1 file changed

+9
-0
lines changed

packages/vite/src/shared/hmr.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,15 @@ export class HMRContext implements ViteHotContext {
155155
this.hmrClient.send({ type: 'custom', event, data })
156156
}
157157

158+
async getExports(): Promise<unknown> {
159+
return this.fullBundleMode
160+
? Promise.resolve().then(() =>
161+
// @ts-expect-error __rolldown_runtime__
162+
__rolldown_runtime__.loadExports(this.ownerPath),
163+
)
164+
: import(this.ownerPath)
165+
}
166+
158167
private acceptDeps(
159168
deps: string[],
160169
callback: HotCallback['fn'] = () => {},

0 commit comments

Comments
 (0)