vike
Version:
The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.
16 lines (15 loc) • 595 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.workaroundCssModuleHmr = workaroundCssModuleHmr;
function workaroundCssModuleHmr() {
return {
name: 'vike:workaroundCssModuleHmr',
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'));
}
}
};
}