12345678910111213141516171819202122232425 |
- import type { Plugin } from 'vite';
- export function configHmrPlugin(): Plugin {
- return {
- name: 'singleHMR',
- handleHotUpdate({ modules, file }) {
- if (file.match(/xml$/)) return [];
- modules.forEach((m) => {
- if (!m.url.match(/\.(css|less)/)) {
- m.importedModules = new Set();
- m.importers = new Set();
- }
- });
- return modules;
- },
- };
- }
|