mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-21 08:20:24 +08:00
26e6434b75
- hippy-vue: ElementNode add repaintWithChildren API - hippy-vue: support remove outdated style of HMR chunk - hippy-vue-loader: support style hmr - hippy-vue-css-loader: support remove outdated style of HMR chunk - debug-server, vue-demo, react-demo, hippy-react: support hmr - debug-server: add hippy-dev command
20 lines
486 B
JavaScript
20 lines
486 B
JavaScript
import hotEmitter from '../hot/emitter';
|
|
import { log } from './log';
|
|
import applyReload from './apply-reload';
|
|
|
|
function reloadApp({ hot, liveReload }, status) {
|
|
const { currentHash, previousHash } = status;
|
|
const isInitial = currentHash.indexOf(previousHash) >= 0;
|
|
|
|
if (isInitial) return;
|
|
|
|
if (hot) {
|
|
log.info('App hot update...');
|
|
hotEmitter.emit('webpackHotUpdate', status.currentHash);
|
|
} else if (liveReload) {
|
|
applyReload();
|
|
}
|
|
}
|
|
|
|
export default reloadApp;
|