2021-10-16 16:16:58 +08:00
|
|
|
import { createProdMockServer } from "vite-plugin-mock/es/createProdMockServer";
|
|
|
|
|
2022-04-18 11:15:46 +08:00
|
|
|
const modules = import.meta.globEager("../mock/*.ts");
|
|
|
|
const mockModules = [];
|
|
|
|
|
|
|
|
Object.keys(modules).forEach(key => {
|
|
|
|
mockModules.push(...modules[key].default);
|
|
|
|
});
|
2021-10-16 16:16:58 +08:00
|
|
|
|
|
|
|
export function setupProdMockServer() {
|
|
|
|
createProdMockServer(mockModules);
|
|
|
|
}
|