refactor: pass updated fleck to @flecks/core/hmr
This commit is contained in:
parent
cf641ae102
commit
e0bd108990
|
@ -43,8 +43,9 @@ module.exports = async (flecks) => {
|
|||
source.push('if (module.hot) {');
|
||||
paths.forEach(([path]) => {
|
||||
source.push(` module.hot.accept('${path}', async () => {`);
|
||||
source.push(` window.flecks.refresh('${path}', require('${path}'));`);
|
||||
source.push(` window.flecks.invoke('@flecks/core/hmr', '${path}');`);
|
||||
source.push(` const updatedFleck = require('${path}');`);
|
||||
source.push(` window.flecks.refresh('${path}', updatedFleck);`);
|
||||
source.push(` window.flecks.invoke('@flecks/core/hmr', '${path}', updatedFleck);`);
|
||||
source.push(' });');
|
||||
});
|
||||
source.push('}');
|
||||
|
|
Loading…
Reference in New Issue
Block a user