test: test hot module replacement

This commit is contained in:
Evan You
2019-12-16 17:57:34 -05:00
parent f194aa0eea
commit 8ea2101553
4 changed files with 166 additions and 4 deletions

View File

@@ -5,6 +5,12 @@ import {
} from './component'
import { queueJob, queuePostFlushCb } from './scheduler'
export interface HMRRuntime {
createRecord: typeof createRecord
rerender: typeof rerender
reload: typeof reload
}
// Expose the HMR runtime on the global object
// This makes it entirely tree-shakable without polluting the exports and makes
// it easier to be used in toolings like vue-loader
@@ -24,7 +30,7 @@ if (__BUNDLER__ && __DEV__) {
createRecord: tryWrap(createRecord),
rerender: tryWrap(rerender),
reload: tryWrap(reload)
}
} as HMRRuntime
}
interface HMRRecord {