mirror of
https://github.com/wmn1525/grasscutterTools.git
synced 2024-11-22 07:08:15 +00:00
14 lines
414 B
TypeScript
14 lines
414 B
TypeScript
import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer';
|
|
// 批量加载
|
|
const modules = import.meta.globEager('./mock/*.ts');
|
|
|
|
const mockModules: Array<string> = [];
|
|
Object.keys(modules).forEach((key) => {
|
|
if (key.includes('/_')) {
|
|
return;
|
|
}
|
|
mockModules.push(...modules[key].default);
|
|
});
|
|
export function setupProdMockServer() {
|
|
createProdMockServer(mockModules);
|
|
} |