vike
Version:
The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.
14 lines (13 loc) • 515 B
JavaScript
export { pluginWorkaroundCssModuleHmr };
function pluginWorkaroundCssModuleHmr() {
return {
name: 'vike:pluginWorkaroundCssModuleHmr',
handleHotUpdate(ctx) {
// prevent full reload due to non self-accepting css module.
// here only "?direct" module should be filtered out as it doesn't have a parent module.
if (ctx.file.includes('module.css')) {
return ctx.modules.filter((m) => !m.id?.includes('?direct'));
}
},
};
}