UNPKG

vike

Version:

The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.

19 lines (18 loc) 664 B
import '../assertEnvVite.js'; export { pluginWorkaroundCssModuleHmr }; function pluginWorkaroundCssModuleHmr() { return [ { name: 'vike:pluginWorkaroundCssModuleHmr', handleHotUpdate: { handler(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')); } }, }, }, ]; }