diff --git a/packages/vite/misc/rolldown-runtime.js b/packages/vite/misc/rolldown-runtime.js index 86b99004b9b7cd..1a2ce4e5cb1b3c 100644 --- a/packages/vite/misc/rolldown-runtime.js +++ b/packages/vite/misc/rolldown-runtime.js @@ -126,8 +126,6 @@ var rolldown_runtime = (self.rolldown_runtime = { }) } }, - // TODO: import.meta.hot.on - on: () => {}, }, }) this.executeModuleStack.push(id) diff --git a/packages/vite/src/node/server/environments/rolldown.ts b/packages/vite/src/node/server/environments/rolldown.ts index 92edbdbba621b1..9ab06e1163656e 100644 --- a/packages/vite/src/node/server/environments/rolldown.ts +++ b/packages/vite/src/node/server/environments/rolldown.ts @@ -244,7 +244,8 @@ class RolldownEnvironment extends DevEnvironment { }, handler(code) { const output = new MagicString(code) - output.replaceAll('import.meta.hot', 'module.hot') + output.replaceAll('import.meta.hot.accept', 'module.hot.accept') + output.replaceAll('import.meta.hot.on', 'self.__rolldown_hot.on') return { code: output.toString(), map: output.generateMap() } }, }, diff --git a/playground/rolldown-dev-vue/vite.config.ts b/playground/rolldown-dev-vue/vite.config.ts index 33b063489fd06e..8b42ccf255c2a9 100644 --- a/playground/rolldown-dev-vue/vite.config.ts +++ b/playground/rolldown-dev-vue/vite.config.ts @@ -8,13 +8,5 @@ export default defineConfig({ hmr: true, }, }, - plugins: [ - vue(), - { - name: 'debug', - buildEnd(err) { - console.log('[buildEnd]', err) - }, - }, - ], + plugins: [vue()], })