mirror of
https://github.com/vitejs/vite.git
synced 2024-11-21 14:48:41 +00:00
15 lines
343 B
JavaScript
15 lines
343 B
JavaScript
export const foo = 1
|
|
export { foo as nestedFoo } from './hmrNestedDep'
|
|
|
|
if (import.meta.hot) {
|
|
const data = import.meta.hot.data
|
|
if ('fromDispose' in data) {
|
|
console.log(`(dep) foo from dispose: ${data.fromDispose}`)
|
|
}
|
|
|
|
import.meta.hot.dispose((data) => {
|
|
console.log(`(dep) foo was: ${foo}`)
|
|
data.fromDispose = foo
|
|
})
|
|
}
|