HMR for blockly blocks
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import * as barrel from './index';
|
||||
import { registerBarrel } from './toolbox';
|
||||
|
||||
registerBarrel(barrel as Record<string, unknown>);
|
||||
|
||||
if (import.meta.hot) {
|
||||
import.meta.hot.accept('./index', (newBarrel) => {
|
||||
if (newBarrel)
|
||||
registerBarrel(newBarrel as Record<string, unknown>);
|
||||
window.dispatchEvent(new CustomEvent('blockly-hmr'));
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user