From e9efbb5e67fd1e964007f27fec53c70d0813457d Mon Sep 17 00:00:00 2001 From: "chenxuehai@alltuu.com" Date: Tue, 21 Feb 2023 17:30:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20ImportMeta=E4=B8=ADglobEager=E5=B7=B2?= =?UTF-8?q?=E5=BA=9F=E5=BC=83=EF=BC=8C=E6=94=B9=E4=B8=BAglob('*',=20{=20ea?= =?UTF-8?q?ger:=20true=20})?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mock/_createProductionServer.ts | 2 +- src/router/index.ts | 2 +- src/store/modules/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mock/_createProductionServer.ts b/mock/_createProductionServer.ts index a44310b..6e3ded7 100644 --- a/mock/_createProductionServer.ts +++ b/mock/_createProductionServer.ts @@ -1,6 +1,6 @@ import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer'; -const modules = import.meta.globEager('./**/*.ts'); +const modules = import.meta.glob('./**/*.ts', { eager: true }); const mockModules: any[] = []; Object.keys(modules).forEach((key) => { diff --git a/src/router/index.ts b/src/router/index.ts index 5d2f10c..8110b5d 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -4,7 +4,7 @@ import { RedirectRoute } from '@/router/base'; import { PageEnum } from '@/enums/pageEnum'; import { createRouterGuards } from './router-guards'; -const modules = import.meta.globEager('./modules/**/*.ts'); +const modules = import.meta.glob('./modules/**/*.ts', { eager: true }); const routeModuleList: RouteRecordRaw[] = []; diff --git a/src/store/modules/index.ts b/src/store/modules/index.ts index 2fc6689..7b9ff57 100644 --- a/src/store/modules/index.ts +++ b/src/store/modules/index.ts @@ -1,4 +1,4 @@ -const allModules = import.meta.globEager('./*/index.ts'); +const allModules = import.meta.glob('./*/index.ts', { eager: true }); const modules = {} as any; Object.keys(allModules).forEach((path) => { const fileName = path.split('/')[1];