feat: use simpler nitro instead of nestjs to implement mock service

This commit is contained in:
vben
2024-07-20 08:31:05 +08:00
parent 9ec91ac16d
commit 9987451647
122 changed files with 2556 additions and 2967 deletions

View File

@@ -9,6 +9,29 @@ interface IImportMap {
[scope: string]: Record<string, string>;
};
}
interface PrintPluginOptions {
/**
* 打印的数据
*/
infoMap?: Record<string, string | undefined>;
}
interface NitroMockPluginOptions {
/**
* mock server 包名
*/
mockServerPackage?: string;
/**
* mock 服务端口
*/
port?: number;
/**
* mock 日志是否打印
*/
verbose?: boolean;
}
/**
* importmap 插件配置
@@ -71,6 +94,14 @@ interface ApplicationPluginOptions extends CommonPluginOptions {
injectGlobalScss?: boolean;
/** 是否注入版权信息 */
license?: boolean;
/** 是否开启nitro mock */
nitroMock?: boolean;
/** nitro mock 插件配置 */
nitroMockOptions?: NitroMockPluginOptions;
/** dev是否开启mock服务 */
print?: boolean;
/** 打印插件配置 */
printInfoMap?: PrintPluginOptions['infoMap'];
/** 是否开启pwa */
pwa?: boolean;
/** pwa 插件配置 */
@@ -111,4 +142,6 @@ export type {
IImportMap,
ImportmapPluginOptions,
LibraryPluginOptions,
NitroMockPluginOptions,
PrintPluginOptions,
};