Skip to content

Commit

Permalink
fix: 修改 mock 文件引入后缀
Browse files Browse the repository at this point in the history
  • Loading branch information
hooray committed Sep 25, 2022
1 parent 47461cd commit 5a75e56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mockProdServer.ts
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down

0 comments on commit 5a75e56

Please sign in to comment.