your link contains the response for your question. Just add in your main.js
file:
window.addEventListener('message', (e) => {
if (e.data && typeof e.data === 'string' && e.data.match(/webpackHotUpdate/)) {
console.log('hot reload happened')
console.clear()
}
})
Example of a complete main.js file:
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
window.addEventListener('message', (e) => {
if (e.data && typeof e.data === 'string' && e.data.match(/webpackHotUpdate/)) {
console.log('hot reload happened')
console.clear()
}
})
EDIT: I didn't read your answers to the github issue. Could you provide some kind of JSON.stringify(e)
on your event message on multiple events so we can check what you have?
console.clear()
in yourcreated
? – Transpire