Skip to content

Commit

Permalink
fix: fix import.meta.hot.on
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Dec 5, 2024
1 parent a652589 commit bda4da7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 0 additions & 2 deletions packages/vite/misc/rolldown-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ var rolldown_runtime = (self.rolldown_runtime = {
})
}
},
// TODO: import.meta.hot.on
on: () => {},
},
})
this.executeModuleStack.push(id)
Expand Down
3 changes: 2 additions & 1 deletion packages/vite/src/node/server/environments/rolldown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() }
},
},
Expand Down
10 changes: 1 addition & 9 deletions playground/rolldown-dev-vue/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,5 @@ export default defineConfig({
hmr: true,
},
},
plugins: [
vue(),
{
name: 'debug',
buildEnd(err) {
console.log('[buildEnd]', err)
},
},
],
plugins: [vue()],
})

0 comments on commit bda4da7

Please sign in to comment.