wireguard-dashboard-admin/mock/_createProdServer.js
zhangchuanlong 8d0158be7c first commit
2022-01-08 17:20:46 +08:00

15 lines
364 B
JavaScript

import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer'
const modules = import.meta.globEager('./**/*.js')
const mockModules = []
Object.keys(modules).forEach((key) => {
if (key.includes('/_')) {
return
}
mockModules.push(...modules[key].default)
})
export function setupProdMockServer() {
createProdMockServer(mockModules)
}