File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,19 @@ io.on("disconnect", function() {
78
78
function reloadApp ( ) {
79
79
if ( hot ) {
80
80
console . log ( "[WDS] App hot update..." ) ;
81
- window . postMessage ( "webpackHotUpdate" + currentHash , "*" ) ;
81
+ try {
82
+ var hotEmitter = require ( "webpack/hot/emitter" ) ;
83
+ hotEmitter . emit ( "webpackHotUpdate" , currentHash ) ;
84
+ } catch ( err ) {
85
+ console . warn (
86
+ "Failed to load \"webpack/hot/emitter.js\". Is your webpack dependency up to date?\n" ,
87
+ err
88
+ ) ;
89
+ }
90
+ if ( typeof WorkerGlobalScope === "undefined" || ! ( self instanceof WorkerGlobalScope ) ) {
91
+ // Not in a web worker; broadcast update to window
92
+ window . postMessage ( "webpackHotUpdate" + currentHash , "*" ) ;
93
+ }
82
94
} else {
83
95
console . log ( "[WDS] App updated. Reloading..." ) ;
84
96
window . location . reload ( ) ;
You can’t perform that action at this time.
0 commit comments