fuse-box/fuse-box

Any HMR API like with webpack? How do I destroy resources between HMR reloads?

samdesota opened this issue · 1 comments

Hey, I'm using fusebox without React, but I can't find any docs for the HMR api. With webpack you can of course use module.hot.dispose and module.hot.accept to customize how hot reloads affect the application, but I can't find any docs on how to do the same for fuse box 4.

Thank you for building a really fast bundler!

const customizedHMRPlugin = {
				hmrUpdate: ({ type }) => {
					if (type === 'js') {
						setTimeout(() => {
							window.location.reload();
						}, 1500);
						return true;
					}
				},
			};

			if (!(window as any).hmrRegistered) {
				(window as any).hmrRegistered = true;
				if ('undefined' !== typeof FuseBox)
					FuseBox.addPlugin(customizedHMRPlugin);
			}