@open-wc/dev-server-hmr
Version:
Plugin for HMR with web components
16 lines (12 loc) • 429 B
JavaScript
const patch = `import { WebComponentHmr } from '/__web-dev-server__/wc-hmr/runtime.js';
HTMLElement.prototype.hotReplacedCallback = function hotReplacedCallback() {
const temp = document.createElement(this.localName);
this._scheduler.renderer = temp._scheduler.renderer;
this._scheduler.update();
};
`;
const haunted = {
functions: [{ name: 'component', import: 'haunted' }],
patch,
};
module.exports = { haunted };