diff --git a/build/vite/optimizer.ts b/build/vite/optimizer.ts deleted file mode 100644 index 8bb0fec..0000000 --- a/build/vite/optimizer.ts +++ /dev/null @@ -1,21 +0,0 @@ -// TODO -import type { GetManualChunk } from 'rollup'; - -// -const vendorLibs: { match: string[]; output: string }[] = [ - // { - // match: ['xlsx'], - // output: 'xlsx', - // }, -]; - -// @ts-ignore -export const configManualChunk: GetManualChunk = (id: string) => { - if (/[\\/]node_modules[\\/]/.test(id)) { - const matchItem = vendorLibs.find((item) => { - const reg = new RegExp(`[\\/]node_modules[\\/]_?(${item.match.join('|')})(.*)`, 'ig'); - return reg.test(id); - }); - return matchItem ? matchItem.output : null; - } -}; diff --git a/build/vite/plugin/hmr.ts b/build/vite/plugin/hmr.ts deleted file mode 100644 index 807fdb9..0000000 --- a/build/vite/plugin/hmr.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { Plugin } from 'vite'; - -/** - * TODO - * Temporarily solve the Vite circular dependency problem, and wait for a better solution to fix it later. I don't know what problems this writing will bring. - * @returns - */ - -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; - }, - }; -}