mirror of
https://gitee.com/yiming_chang/vue-pure-admin.git
synced 2024-12-03 11:49:21 +08:00
15 lines
364 B
TypeScript
15 lines
364 B
TypeScript
import { createProdMockServer } from "vite-plugin-mock/es/createProdMockServer";
|
|
|
|
const modules: Record<string, any> = import.meta.glob("../mock/*.ts", {
|
|
eager: true
|
|
});
|
|
const mockModules = [];
|
|
|
|
Object.keys(modules).forEach(key => {
|
|
mockModules.push(...modules[key].default);
|
|
});
|
|
|
|
export function setupProdMockServer() {
|
|
createProdMockServer(mockModules);
|
|
}
|