mirror of
https://gitee.com/fantastic-admin/basic.git
synced 2024-12-10 07:58:27 +08:00
修复mock文件引入后缀错误
This commit is contained in:
parent
03a10f569c
commit
3a196d6809
@ -1,9 +1,9 @@
|
|||||||
import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer'
|
import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer'
|
||||||
|
|
||||||
const mocks: any[] = []
|
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) => {
|
Object.keys(mockContext).forEach((v) => {
|
||||||
mocks.push(...mockContext[v].default)
|
mocks.push(...(mockContext[v] as any).default)
|
||||||
})
|
})
|
||||||
|
|
||||||
export function setupProdMockServer() {
|
export function setupProdMockServer() {
|
||||||
|
Loading…
Reference in New Issue
Block a user