fix: add type for importMetaGlob

This commit is contained in:
chenxuehai@alltuu.com
2023-03-10 11:23:06 +08:00
parent dc98b96ce2
commit 3d6465346c
4 changed files with 25 additions and 11 deletions

View File

@@ -1,6 +1,10 @@
import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer';
const modules = import.meta.glob('./**/*.ts', { eager: true });
interface IModuleType {
default: any[];
}
const modules = import.meta.glob<IModuleType>('./**/*.ts', { eager: true });
const mockModules: any[] = [];
Object.keys(modules).forEach((key) => {