You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it should actually do a full reload when it's required, not just reporting a need because it's really simple to miss the report among other HMR/app's messages. If making it a default behaviour is too much, an option would suffice.
'Root or manually mounted instance modified. Full reload required.'
)
To anyone who also think so, you can use this snippet until the option is introduce or the default behaviour is changed:
// webpack.config.jsconstVueReload=require('../plugins/vue-reload')module.exports={plugins: [newVueReload()]}// vue-reload.jsmodule.exports=classVueReloadPlugin{apply(compiler){compiler.hooks.compilation.tap('VueReloadPlugin',compilation=>{compilation.hooks.processAssets.tap({name: 'VueReloadPlugin',stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{constpatched=[]for(constchunkofcompilation.chunks){constanyVueModules=chunk.getModules().some((module)=>/\.vue/.test(module.resource))if(!anyVueModules){continue}for(constfileofchunk.files){constisJSFile=/\.js/.test(file)if(!isJSFile){continue}compilation.updateAsset(file,(input)=>{// the \\n part is necessary in case the source code is turned into an eval stringconstre=/(console\.warn\([\s\\n]*['"](?:Something went wrong during Vue component hot-reload.|Root or manually mounted instance modified.) Full reload required.['"][\s\\n]*\))/gconstmatches=Array.from(input.source().matchAll(re))if(matches.length===0){returninput}constoutput=newReplaceSource(input)for(constmatchofmatches){constposition=match.index+match[1].lengthoutput.insert(position,';window.location.reload();')}patched.push(file)returnoutput})}}if(patched.length!==0){console.info('vue-reload-plugin: patched',patched.join(', '))}})})}}
The text was updated successfully, but these errors were encountered:
I think it should actually do a full reload when it's required, not just reporting a need because it's really simple to miss the report among other HMR/app's messages. If making it a default behaviour is too much, an option would suffice.
vue-hot-reload-api/src/index.js
Lines 122 to 125 in 45936fb
vue-hot-reload-api/src/index.js
Lines 246 to 248 in 45936fb
To anyone who also think so, you can use this snippet until the option is introduce or the default behaviour is changed:
The text was updated successfully, but these errors were encountered: