-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ts
More file actions
66 lines (61 loc) · 1.26 KB
/
config.ts
File metadata and controls
66 lines (61 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
export const DAO3_API_BASE = "https://code-api-pc.dao3.fun/";
export interface IDao3Response<T = unknown> {
code: number;
msg?: string;
data: T;
}
/**
* 单侧(client/server)bundle 配置
*/
export interface IBundleSide {
/**
* 入口文件路径(相对 client/src 或 server/src)
*/
entry: string;
}
/**
* 单个 bundle 的完整配置
*/
export interface IBundleConfig {
/**
* 客户端脚本配置(打包为 ESM)
*/
client: IBundleSide;
/**
* 服务端脚本配置(打包为 CJS)
*/
server: IBundleSide;
/**
* 是否启用当前 bundle 配置
* - true:在需要时可参与构建
* - false:不参与构建(即使在单入口场景下也不会被使用)
*/
enable: boolean;
}
/**
* 配置结构
*/
export interface IDao3Config {
/**
* 所有可打包的脚本 bundle 信息,key 和 VITE_CURRENT_FILE 对应
*/
bundles: Record<string, IBundleConfig>;
}
/**
* 上传插件运行时需要的参数
*/
export interface IUploadBundleOptions {
/**
* 本次构建的输出目录(绝对路径)
*/
outDir: string;
/**
* 构建目标,client / server
*/
target?: string;
/**
* 环境变量
* - 需包含神岛相关信息
*/
env: Record<string, string>;
}