From 3a196d680968eea546bce26218bfa43e8f8f365d Mon Sep 17 00:00:00 2001 From: hooray <304327508@qq.com> Date: Mon, 26 Sep 2022 00:28:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmock=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=BC=95=E5=85=A5=E5=90=8E=E7=BC=80=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mockProdServer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mockProdServer.ts b/src/mockProdServer.ts index a9900a0..c5f0fc8 100644 --- a/src/mockProdServer.ts +++ b/src/mockProdServer.ts @@ -1,9 +1,9 @@ import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer' const mocks: any[] = [] -const mockContext: any = import.meta.glob('./mock/*.js', { eager: true }) +const mockContext = import.meta.glob('./mock/*.ts', { eager: true }) Object.keys(mockContext).forEach((v) => { - mocks.push(...mockContext[v].default) + mocks.push(...(mockContext[v] as any).default) }) export function setupProdMockServer() {