UNPKG

vite-plugin-vue-css-modules

Version:

✨ Ultimate solution for using CSS modules without any hassle. Automatic replacement for Vue templates and scripts

16 lines (15 loc) 451 B
export function removeCssModulesChunk({ ignore = [], } = {}) { return { name: "Remove CSS Modules Chunk", enforce: "post", transform(code, id) { if (/\.vue/g.test(id)) { for (let p of ignore) { if (p.test(id)) return null; } return code.replace(/\[["']__cssModules["'],.+?\],?/g, ""); } }, }; }