@cocos/ccbuild 2.0.3-alpha.3 → 2.0.3-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +206 -0
- package/README.md +16 -37
- package/modules/build-engine/lib/engine-js/index.d.ts.map +1 -1
- package/modules/build-engine/lib/engine-js/index.js +4 -1
- package/modules/build-engine/lib/engine-js/index.js.map +1 -1
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.d.ts +33 -33
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.d.ts.map +1 -1
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.js +72 -43
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.js.map +1 -1
- package/modules/build-engine/lib/engine-ts/plugins/external-wasm-loader.js +1 -1
- package/modules/build-engine/lib/engine-ts/plugins/external-wasm-loader.js.map +1 -1
- package/modules/build-engine/lib/engine-ts/plugins/interface.d.ts +14 -14
- package/modules/build-engine/lib/index.d.ts +88 -86
- package/modules/build-engine/lib/index.d.ts.map +1 -1
- package/modules/build-engine/lib/index.js +53 -38
- package/modules/build-engine/lib/index.js.map +1 -1
- package/modules/stats-query/lib/config-interface.d.ts +61 -61
- package/modules/stats-query/lib/index.d.ts +54 -54
- package/modules/stats-query/lib/index.js +38 -38
- package/package.json +16 -13
- package/static/helper-dynamic-constants.txt +13 -13
- package/static/helper-file-decorator.ts +20 -20
- package/static/helper-global-exporter.txt +8 -8
- package/static/lib.dom.d.ts +2330 -2330
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-wasm-loader.js","sourceRoot":"","sources":["../../../src/engine-ts/plugins/external-wasm-loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,+BAAmC;AACnC,mCAAoC;AAEpC,0CAA4C;AAE5C,MAAM,cAAc,GAAG,WAAW,CAAC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BACpD,SAAS,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC;oBACvB,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;oBACvB,OAAO,EAAE,CAAC;iBACb;gBACD,OAAO,SAAS,CAAC;YACrB,CAAC;SAAA;QAEK,IAAI,CAAE,EAAU;;gBAClB,IAAI,EAAE,IAAI,SAAS,EAAE;oBACjB,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE;wBAC7B,IAAI,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;4BACrB,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;4BAClC,IAAI,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE;gCACtC,OAAO,MAAM,CAAC,cAAc,CAAC;6BAChC;iCAAM,IAAI,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE;gCAC5C,OAAO,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;6BACjC;iCAAM;gCACH,OAAO,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;6BACtC;yBACJ;qBACJ;oBACD,WAAW;oBACX,OAAO,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;iBACtC;YACL,CAAC;SAAA;QAED,WAAW,CAAE,MAAc,EAAE,QAAiB;YAC1C,IAAI,MAAM,IAAI,SAAS,EAAE;gBACrB,IAAI,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;gBAC3B,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,MAAM,CAAC,CAAC;gBAClC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"external-wasm-loader.js","sourceRoot":"","sources":["../../../src/engine-ts/plugins/external-wasm-loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;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,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;gBAClE,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC9C,EAAE,GAAG,GAAG,EAAE,IAAI,IAAI,KAAK,CAAC;gBACxB,OAAO,EAAE,CAAC;aACb;QACL,CAAC;KACJ,CAAC;IAEF,OAAO,kBAAkB,CAAC;AAC9B,CAAC;AA9CD,8DA8CC"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
export interface ITsEnginePlugin {
|
|
2
2
|
buildStart?(): Promise<void>;
|
|
3
|
-
/**
|
|
4
|
-
* The hook to resolve id, return `null` if this plugin cannot handle this script.
|
|
5
|
-
* This hook is to transform source to id, which is the exact file path we read from.
|
|
6
|
-
* @param source
|
|
7
|
-
* @param importer
|
|
3
|
+
/**
|
|
4
|
+
* The hook to resolve id, return `null` if this plugin cannot handle this script.
|
|
5
|
+
* This hook is to transform source to id, which is the exact file path we read from.
|
|
6
|
+
* @param source
|
|
7
|
+
* @param importer
|
|
8
8
|
*/
|
|
9
9
|
resolve?(source: string, importer?: string): Promise<string | void>;
|
|
10
|
-
/**
|
|
11
|
-
* The hook to load script, return `null` if this plugin cannot handle this script.
|
|
12
|
-
* This hook decide how we load the script content from the module id.
|
|
13
|
-
* @param id
|
|
10
|
+
/**
|
|
11
|
+
* The hook to load script, return `null` if this plugin cannot handle this script.
|
|
12
|
+
* This hook decide how we load the script content from the module id.
|
|
13
|
+
* @param id
|
|
14
14
|
*/
|
|
15
15
|
load?(id: string): Promise<string | void>;
|
|
16
|
-
/**
|
|
17
|
-
* The hook to transform id, return the absolute file path or null.
|
|
18
|
-
* This hook is to transform module source to an override module id, which is for the output module id.
|
|
19
|
-
* This output module id would also affect the import relative path in the output module.
|
|
20
|
-
* @param source
|
|
16
|
+
/**
|
|
17
|
+
* The hook to transform id, return the absolute file path or null.
|
|
18
|
+
* This hook is to transform module source to an override module id, which is for the output module id.
|
|
19
|
+
* This output module id would also affect the import relative path in the output module.
|
|
20
|
+
* @param source
|
|
21
21
|
*/
|
|
22
22
|
transformId?(source: string, importer?: string): string | void;
|
|
23
23
|
buildEnd?(): Promise<void>;
|
|
@@ -3,121 +3,123 @@ export declare function buildEngine(options: buildEngine.Options): Promise<build
|
|
|
3
3
|
export declare namespace buildEngine {
|
|
4
4
|
type ModuleFormat = 'esm' | 'cjs' | 'system' | 'iife';
|
|
5
5
|
interface Options {
|
|
6
|
-
/**
|
|
7
|
-
* 引擎仓库目录。
|
|
6
|
+
/**
|
|
7
|
+
* 引擎仓库目录。
|
|
8
8
|
*/
|
|
9
9
|
engine: string;
|
|
10
|
-
/**
|
|
11
|
-
* 输出目录。
|
|
10
|
+
/**
|
|
11
|
+
* 输出目录。
|
|
12
12
|
*/
|
|
13
13
|
out: string;
|
|
14
14
|
mode: StatsQuery.ConstantManager.ModeType;
|
|
15
15
|
platform: StatsQuery.ConstantManager.PlatformType;
|
|
16
16
|
flags?: Partial<StatsQuery.ConstantManager.IFlagConfig>;
|
|
17
|
-
/**
|
|
18
|
-
* 包含的功能。
|
|
17
|
+
/**
|
|
18
|
+
* 包含的功能。
|
|
19
19
|
*/
|
|
20
20
|
features?: string[];
|
|
21
|
-
/**
|
|
22
|
-
* 输出模块格式。
|
|
23
|
-
* @default 'system'
|
|
21
|
+
/**
|
|
22
|
+
* 输出模块格式。
|
|
23
|
+
* @default 'system'
|
|
24
24
|
*/
|
|
25
25
|
moduleFormat?: ModuleFormat;
|
|
26
|
-
/**
|
|
27
|
-
* 是否对生成结果进行压缩。
|
|
28
|
-
* @default false
|
|
26
|
+
/**
|
|
27
|
+
* 是否对生成结果进行压缩。
|
|
28
|
+
* @default false
|
|
29
29
|
*/
|
|
30
30
|
compress?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* 是否生成 source map。
|
|
33
|
-
* 若为 `inline` 则生成内联的 source map。
|
|
34
|
-
* @default false
|
|
31
|
+
/**
|
|
32
|
+
* 是否生成 source map。
|
|
33
|
+
* 若为 `inline` 则生成内联的 source map。
|
|
34
|
+
* @default false
|
|
35
35
|
*/
|
|
36
36
|
sourceMap?: boolean | 'inline';
|
|
37
|
-
/**
|
|
38
|
-
* 若 `sourceMap` 为 `true`,此选项指定了 source map 的路径。
|
|
39
|
-
* @default `${outputPath.map}`
|
|
37
|
+
/**
|
|
38
|
+
* 若 `sourceMap` 为 `true`,此选项指定了 source map 的路径。
|
|
39
|
+
* @default `${outputPath.map}`
|
|
40
40
|
*/
|
|
41
41
|
sourceMapFile?: string;
|
|
42
|
-
/**
|
|
43
|
-
* 若为 `true`,分割出 **所有** 引擎子模块。
|
|
44
|
-
* 否则,`.moduleEntries` 指定的所有子模块将被合并成一个单独的 `"cc"` 模块。
|
|
45
|
-
* @default false
|
|
42
|
+
/**
|
|
43
|
+
* 若为 `true`,分割出 **所有** 引擎子模块。
|
|
44
|
+
* 否则,`.moduleEntries` 指定的所有子模块将被合并成一个单独的 `"cc"` 模块。
|
|
45
|
+
* @default false
|
|
46
46
|
*/
|
|
47
47
|
split?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* 使用的 ammo.js 版本,也即 `@cocos/ammo` 映射到的版本。
|
|
50
|
-
* - 为 `true` 时使用 WebAssembly 版本的 ammo.js;
|
|
51
|
-
* - 为 `false` 时使用 asm.js 版本的 ammo.js;
|
|
52
|
-
* - 为 `'fallback` 时同时在结果中包含两个版本的 ammo.js,并自动根据环境 fallback 选择。
|
|
53
|
-
*
|
|
54
|
-
* 注意,`'fallback'` 只有在 SystemJS 和 Async functions 同时支持时才有效。
|
|
55
|
-
* @default true
|
|
56
|
-
*
|
|
57
|
-
* @deprecated 从 1.1.5 版本开始,该选项只会影响 FORCE_BANNING_BULLET_WASM 宏的值
|
|
58
|
-
* - 为 `true` 时,FORCE_BANNING_BULLET_WASM 为 false
|
|
59
|
-
* - 为 `false` 时,FORCE_BANNING_BULLET_WASM 为 true
|
|
60
|
-
* - 为 `'fallback'` 时, FORCE_BANNING_BULLET_WASM 为 false
|
|
48
|
+
/**
|
|
49
|
+
* 使用的 ammo.js 版本,也即 `@cocos/ammo` 映射到的版本。
|
|
50
|
+
* - 为 `true` 时使用 WebAssembly 版本的 ammo.js;
|
|
51
|
+
* - 为 `false` 时使用 asm.js 版本的 ammo.js;
|
|
52
|
+
* - 为 `'fallback` 时同时在结果中包含两个版本的 ammo.js,并自动根据环境 fallback 选择。
|
|
53
|
+
*
|
|
54
|
+
* 注意,`'fallback'` 只有在 SystemJS 和 Async functions 同时支持时才有效。
|
|
55
|
+
* @default true
|
|
56
|
+
*
|
|
57
|
+
* @deprecated 从 1.1.5 版本开始,该选项只会影响 FORCE_BANNING_BULLET_WASM 宏的值
|
|
58
|
+
* - 为 `true` 时,FORCE_BANNING_BULLET_WASM 为 false
|
|
59
|
+
* - 为 `false` 时,FORCE_BANNING_BULLET_WASM 为 true
|
|
60
|
+
* - 为 `'fallback'` 时, FORCE_BANNING_BULLET_WASM 为 false
|
|
61
61
|
*/
|
|
62
62
|
ammoJsWasm?: boolean | 'fallback';
|
|
63
|
-
/**
|
|
64
|
-
* If true, all deprecated features/API are excluded.
|
|
65
|
-
* You can also specify a version range(in semver range) to exclude deprecations in specified version(s).
|
|
66
|
-
* @default false
|
|
63
|
+
/**
|
|
64
|
+
* If true, all deprecated features/API are excluded.
|
|
65
|
+
* You can also specify a version range(in semver range) to exclude deprecations in specified version(s).
|
|
66
|
+
* @default false
|
|
67
67
|
*/
|
|
68
68
|
noDeprecatedFeatures?: string | boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Experimental.
|
|
69
|
+
/**
|
|
70
|
+
* Experimental.
|
|
71
71
|
*/
|
|
72
72
|
incremental?: string;
|
|
73
|
-
/**
|
|
74
|
-
* BrowsersList targets.
|
|
73
|
+
/**
|
|
74
|
+
* BrowsersList targets.
|
|
75
75
|
*/
|
|
76
76
|
targets?: string | string[] | Record<string, string>;
|
|
77
|
-
/**
|
|
78
|
-
* Enable loose compilation.
|
|
77
|
+
/**
|
|
78
|
+
* Enable loose compilation.
|
|
79
|
+
*
|
|
80
|
+
* @deprecated since 1.1.20, we force using true internal.
|
|
79
81
|
*/
|
|
80
82
|
loose?: boolean;
|
|
81
|
-
/**
|
|
82
|
-
* How to generate the reference to external assets:
|
|
83
|
-
* - `'relative-from-out'`
|
|
84
|
-
* Generate the path relative from `out` directory, does not contain the leading './'.
|
|
85
|
-
*
|
|
86
|
-
* - `'relative-from-chunk'`
|
|
87
|
-
* Generate the path relative from the referencing output chunk.
|
|
88
|
-
*
|
|
89
|
-
* - `'dynamic'`(default)
|
|
90
|
-
* Use runtime `URL` API to resolve the absolute URL.
|
|
91
|
-
* This requires `URL` and `import.meta.url` to be valid.
|
|
83
|
+
/**
|
|
84
|
+
* How to generate the reference to external assets:
|
|
85
|
+
* - `'relative-from-out'`
|
|
86
|
+
* Generate the path relative from `out` directory, does not contain the leading './'.
|
|
87
|
+
*
|
|
88
|
+
* - `'relative-from-chunk'`
|
|
89
|
+
* Generate the path relative from the referencing output chunk.
|
|
90
|
+
*
|
|
91
|
+
* - `'dynamic'`(default)
|
|
92
|
+
* Use runtime `URL` API to resolve the absolute URL.
|
|
93
|
+
* This requires `URL` and `import.meta.url` to be valid.
|
|
92
94
|
*/
|
|
93
95
|
assetURLFormat?: 'relative-from-out' | 'relative-from-chunk' | 'runtime-resolved';
|
|
94
|
-
/**
|
|
95
|
-
* Preserve engine type info, this options will build a TS engine to the output directory.
|
|
96
|
-
* It's useful when we need to take a step towards the AOT optimization.
|
|
97
|
-
* This options is only supported on Open Harmony platform for now.
|
|
98
|
-
* @default false
|
|
96
|
+
/**
|
|
97
|
+
* Preserve engine type info, this options will build a TS engine to the output directory.
|
|
98
|
+
* It's useful when we need to take a step towards the AOT optimization.
|
|
99
|
+
* This options is only supported on Open Harmony platform for now.
|
|
100
|
+
* @default false
|
|
99
101
|
*/
|
|
100
102
|
preserveType?: boolean;
|
|
101
103
|
}
|
|
102
104
|
interface Result {
|
|
103
|
-
/**
|
|
104
|
-
* Mappings between feature unit name and their actual chunk file, for example:
|
|
105
|
-
* ```js
|
|
106
|
-
* {
|
|
107
|
-
* "core": "./core.js",
|
|
108
|
-
* "gfx-webgl": "./gfx-webgl.js",
|
|
109
|
-
* }
|
|
110
|
-
* ```
|
|
105
|
+
/**
|
|
106
|
+
* Mappings between feature unit name and their actual chunk file, for example:
|
|
107
|
+
* ```js
|
|
108
|
+
* {
|
|
109
|
+
* "core": "./core.js",
|
|
110
|
+
* "gfx-webgl": "./gfx-webgl.js",
|
|
111
|
+
* }
|
|
112
|
+
* ```
|
|
111
113
|
*/
|
|
112
114
|
exports: Record<string, string>;
|
|
113
|
-
/**
|
|
114
|
-
* The compulsory import mappings that should be applied.
|
|
115
|
+
/**
|
|
116
|
+
* The compulsory import mappings that should be applied.
|
|
115
117
|
*/
|
|
116
118
|
chunkAliases: Record<string, string>;
|
|
117
|
-
/**
|
|
118
|
-
* The dependency graph, only including dependency chunks.
|
|
119
|
-
*
|
|
120
|
-
* @deprecated please use `chunkDepGraph` instead.
|
|
119
|
+
/**
|
|
120
|
+
* The dependency graph, only including dependency chunks.
|
|
121
|
+
*
|
|
122
|
+
* @deprecated please use `chunkDepGraph` instead.
|
|
121
123
|
*/
|
|
122
124
|
dependencyGraph?: Record<string, string[]>;
|
|
123
125
|
chunkDepGraph: Record<string, string[]>;
|
|
@@ -128,18 +130,18 @@ export declare namespace buildEngine {
|
|
|
128
130
|
code: string;
|
|
129
131
|
}>;
|
|
130
132
|
function isSourceChanged(incrementalFile: string): Promise<boolean>;
|
|
131
|
-
/**
|
|
132
|
-
* Enumerates all chunk files that used by specified feature units.
|
|
133
|
-
* @param meta Metadata of build result.
|
|
134
|
-
* @param featureUnits Feature units.
|
|
135
|
-
*
|
|
136
|
-
* @deprecated since 1.1.11, please use `enumerateAllDependents` instead.
|
|
133
|
+
/**
|
|
134
|
+
* Enumerates all chunk files that used by specified feature units.
|
|
135
|
+
* @param meta Metadata of build result.
|
|
136
|
+
* @param featureUnits Feature units.
|
|
137
|
+
*
|
|
138
|
+
* @deprecated since 1.1.11, please use `enumerateAllDependents` instead.
|
|
137
139
|
*/
|
|
138
140
|
function enumerateDependentChunks(meta: buildEngine.Result, featureUnits: string[]): string[];
|
|
139
|
-
/**
|
|
140
|
-
* Enumerates all chunk files and asset files that used by specified feature units.
|
|
141
|
-
* @param meta Metadata of build result.
|
|
142
|
-
* @param featureUnits Feature units.
|
|
141
|
+
/**
|
|
142
|
+
* Enumerates all chunk files and asset files that used by specified feature units.
|
|
143
|
+
* @param meta Metadata of build result.
|
|
144
|
+
* @param featureUnits Feature units.
|
|
143
145
|
*/
|
|
144
146
|
function enumerateAllDependents(meta: buildEngine.Result, featureUnits: string[]): string[];
|
|
145
147
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AA2BlD,wBAAsB,WAAW,CAAE,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAmB5F;AAED,yBAAiB,WAAW,CAAC;IACzB,KAAY,YAAY,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAE7D,UAAiB,OAAO;QACpB;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;QAEf;;WAEG;QACH,GAAG,EAAE,MAAM,CAAC;QAGZ,IAAI,EAAE,UAAU,CAAC,eAAe,CAAC,QAAQ,CAAC;QAE1C,QAAQ,EAAE,UAAU,CAAC,eAAe,CAAC,YAAY,CAAC;QAElD,KAAK,CAAC,EAAE,OAAO,CAAC,UAAU,CA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AAE,CAAC,CAAC;QAExC,gBAAgB,EAAE,OAAO,CAAC;KAC7B;IAED,SAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;KAAE,CAAC,CAWrH;IAED,SAAsB,eAAe,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAuB/E;IA0CD;;;;;;OAMG;IACH,SAAgB,wBAAwB,CAAE,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAEpG;IAED;;;;OAIG;IACH,SAAgB,sBAAsB,CAAE,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAIlG;CACJ"}
|
|
@@ -47,7 +47,9 @@ function verifyCache(options) {
|
|
|
47
47
|
function applyDefaultOptions(options) {
|
|
48
48
|
var _a;
|
|
49
49
|
(_a = options.preserveType) !== null && _a !== void 0 ? _a : options.preserveType = false;
|
|
50
|
+
options.loose = true; // force using true
|
|
50
51
|
}
|
|
52
|
+
|
|
51
53
|
function moduleOptionsToBabelEnvModules(moduleOptions) {
|
|
52
54
|
switch (moduleOptions) {
|
|
53
55
|
case 'cjs':
|
|
@@ -62,31 +64,6 @@ function moduleOptionsToBabelEnvModules(moduleOptions) {
|
|
|
62
64
|
throw new Error(`Unknown module format ${moduleOptions}`);
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
|
-
function _enumerateDependentFromDepGraph(metaExports, metaDepGraph, featureUnits) {
|
|
66
|
-
const result = [];
|
|
67
|
-
const visited = new Set();
|
|
68
|
-
const addChunk = chunkFileName => {
|
|
69
|
-
if (visited.has(chunkFileName)) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
visited.add(chunkFileName);
|
|
73
|
-
result.push(chunkFileName);
|
|
74
|
-
if (metaDepGraph && chunkFileName in metaDepGraph) {
|
|
75
|
-
for (const dependencyChunk of metaDepGraph[chunkFileName]) {
|
|
76
|
-
addChunk(dependencyChunk);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
for (const featureUnit of featureUnits) {
|
|
81
|
-
const chunkFileName = metaExports[featureUnit];
|
|
82
|
-
if (!chunkFileName) {
|
|
83
|
-
console.error(`Feature unit ${featureUnit} is not in build result!`);
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
addChunk(chunkFileName);
|
|
87
|
-
}
|
|
88
|
-
return result;
|
|
89
|
-
}
|
|
90
67
|
function buildEngine(options) {
|
|
91
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
92
69
|
applyDefaultOptions(options);
|
|
@@ -155,25 +132,63 @@ exports.buildEngine = buildEngine;
|
|
|
155
132
|
});
|
|
156
133
|
}
|
|
157
134
|
buildEngine.isSourceChanged = isSourceChanged;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
135
|
+
function _enumerateDependentChunks(meta, featureUnits) {
|
|
136
|
+
const metaExports = meta.exports;
|
|
137
|
+
const metaDepGraph = meta.chunkDepGraph;
|
|
138
|
+
const result = [];
|
|
139
|
+
const visited = new Set();
|
|
140
|
+
const addChunk = chunkFileName => {
|
|
141
|
+
if (visited.has(chunkFileName)) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
visited.add(chunkFileName);
|
|
145
|
+
result.push(chunkFileName);
|
|
146
|
+
if (metaDepGraph && chunkFileName in metaDepGraph) {
|
|
147
|
+
for (const dependencyChunk of metaDepGraph[chunkFileName]) {
|
|
148
|
+
addChunk(dependencyChunk);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
for (const featureUnit of featureUnits) {
|
|
153
|
+
const chunkFileName = metaExports[featureUnit];
|
|
154
|
+
if (!chunkFileName) {
|
|
155
|
+
console.error(`Feature unit ${featureUnit} is not in build result!`);
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
addChunk(chunkFileName);
|
|
159
|
+
}
|
|
160
|
+
return result;
|
|
161
|
+
}
|
|
162
|
+
function _enumerateDependentAssets(meta, dependentChunks) {
|
|
163
|
+
const metaDepAsset = meta.assetDepGraph;
|
|
164
|
+
let result = [];
|
|
165
|
+
for (const chunkName of dependentChunks) {
|
|
166
|
+
const depAssets = metaDepAsset[chunkName];
|
|
167
|
+
if ((depAssets === null || depAssets === void 0 ? void 0 : depAssets.length) > 0) {
|
|
168
|
+
result = result.concat(depAssets);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Enumerates all chunk files that used by specified feature units.
|
|
175
|
+
* @param meta Metadata of build result.
|
|
176
|
+
* @param featureUnits Feature units.
|
|
177
|
+
*
|
|
178
|
+
* @deprecated since 1.1.11, please use `enumerateAllDependents` instead.
|
|
164
179
|
*/
|
|
165
180
|
function enumerateDependentChunks(meta, featureUnits) {
|
|
166
|
-
return
|
|
181
|
+
return _enumerateDependentChunks(meta, featureUnits);
|
|
167
182
|
}
|
|
168
183
|
buildEngine.enumerateDependentChunks = enumerateDependentChunks;
|
|
169
|
-
/**
|
|
170
|
-
* Enumerates all chunk files and asset files that used by specified feature units.
|
|
171
|
-
* @param meta Metadata of build result.
|
|
172
|
-
* @param featureUnits Feature units.
|
|
184
|
+
/**
|
|
185
|
+
* Enumerates all chunk files and asset files that used by specified feature units.
|
|
186
|
+
* @param meta Metadata of build result.
|
|
187
|
+
* @param featureUnits Feature units.
|
|
173
188
|
*/
|
|
174
189
|
function enumerateAllDependents(meta, featureUnits) {
|
|
175
|
-
const dependentChunks =
|
|
176
|
-
const dependentAssets =
|
|
190
|
+
const dependentChunks = _enumerateDependentChunks(meta, featureUnits);
|
|
191
|
+
const dependentAssets = _enumerateDependentAssets(meta, dependentChunks);
|
|
177
192
|
return dependentAssets.concat(dependentChunks);
|
|
178
193
|
}
|
|
179
194
|
buildEngine.enumerateAllDependents = enumerateAllDependents;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,2CAA4C;AAC5C,sDAA6C;AAC7C,wDAA0B;AAC1B,2CAA4C;AAE5C,SAAS,WAAW,CAAE,OAA4B;IACjD,OAAO;IACP,OAAO,KAAK,CAAC;AACd,CAAC;AAED,SAAS,mBAAmB,CAAE,OAA4B;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,2CAA4C;AAC5C,sDAA6C;AAC7C,wDAA0B;AAC1B,2CAA4C;AAE5C,SAAS,WAAW,CAAE,OAA4B;IACjD,OAAO;IACP,OAAO,KAAK,CAAC;AACd,CAAC;AAED,SAAS,mBAAmB,CAAE,OAA4B;;IACtD,MAAA,OAAO,CAAC,YAAY,oCAApB,OAAO,CAAC,YAAY,GAAK,KAAK,EAAC;IAC/B,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAE,mBAAmB;AAC9C,CAAC;AAED,SAAS,8BAA8B,CAAC,aAAuC;IAC3E,QAAQ,aAAa,EAAE;QACvB,KAAK,KAAK,CAAC,CAAC,OAAO,UAAU,CAAC;QAC9B,KAAK,QAAQ,CAAC,CAAC,OAAO,UAAU,CAAC;QACjC,KAAK,MAAM,CAAC;QACZ,KAAK,KAAK,CAAC,CAAC,OAAO,KAAK,CAAC;QACrB,4EAA4E;QAChF,OAAO,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,yBAAyB,aAAa,EAAE,CAAC,CAAC;KAClE;AACL,CAAC;AAED,SAAsB,WAAW,CAAE,OAA4B;;QAC9D,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAE7B,IAAI,WAAW,CAAC,O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,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IACnD,CAAC;IAJe,kCAAsB,yBAIrC,CAAA;AACL,CAAC,EA7QgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QA6Q3B"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export interface Config {
|
|
2
|
-
/**
|
|
3
|
-
* Engine features. Keys are feature IDs.
|
|
2
|
+
/**
|
|
3
|
+
* Engine features. Keys are feature IDs.
|
|
4
4
|
*/
|
|
5
5
|
features: Record<string, Feature>;
|
|
6
|
-
/**
|
|
7
|
-
* Describe how to generate the index module `'cc'`.
|
|
8
|
-
* Currently not used.
|
|
6
|
+
/**
|
|
7
|
+
* Describe how to generate the index module `'cc'`.
|
|
8
|
+
* Currently not used.
|
|
9
9
|
*/
|
|
10
10
|
index?: IndexConfig;
|
|
11
11
|
moduleOverrides?: Array<{
|
|
@@ -13,58 +13,58 @@ export interface Config {
|
|
|
13
13
|
overrides: Record<string, string>;
|
|
14
14
|
isVirtualModule: boolean;
|
|
15
15
|
}>;
|
|
16
|
-
/**
|
|
17
|
-
* Included files for quick-compiler.
|
|
16
|
+
/**
|
|
17
|
+
* Included files for quick-compiler.
|
|
18
18
|
*/
|
|
19
19
|
includes: Array<string>;
|
|
20
|
-
/**
|
|
21
|
-
* The constants config for engine and user.
|
|
20
|
+
/**
|
|
21
|
+
* The constants config for engine and user.
|
|
22
22
|
*/
|
|
23
23
|
constants: IConstantConfig;
|
|
24
|
-
/**
|
|
25
|
-
* The decorators to be optimize when build engine.
|
|
24
|
+
/**
|
|
25
|
+
* The decorators to be optimize when build engine.
|
|
26
26
|
*/
|
|
27
27
|
optimizeDecorators: IOptimizeDecorators;
|
|
28
28
|
}
|
|
29
29
|
export interface IndexConfig {
|
|
30
30
|
modules?: Record<string, {
|
|
31
|
-
/**
|
|
32
|
-
* If specified, export contents of the module into a namespace specified by `ns`
|
|
33
|
-
* and then export that namespace into `'cc'`.
|
|
34
|
-
* If not specified, contents of the module will be directly exported into `'cc'`.
|
|
31
|
+
/**
|
|
32
|
+
* If specified, export contents of the module into a namespace specified by `ns`
|
|
33
|
+
* and then export that namespace into `'cc'`.
|
|
34
|
+
* If not specified, contents of the module will be directly exported into `'cc'`.
|
|
35
35
|
*/
|
|
36
36
|
ns?: string;
|
|
37
|
-
/**
|
|
38
|
-
* If `true`, accesses the exports of this module from `'cc'` will be marked as deprecated.
|
|
37
|
+
/**
|
|
38
|
+
* If `true`, accesses the exports of this module from `'cc'` will be marked as deprecated.
|
|
39
39
|
*/
|
|
40
40
|
deprecated?: boolean;
|
|
41
41
|
}>;
|
|
42
42
|
}
|
|
43
43
|
export type Test = string;
|
|
44
|
-
/**
|
|
45
|
-
* An engine feature.
|
|
44
|
+
/**
|
|
45
|
+
* An engine feature.
|
|
46
46
|
*/
|
|
47
47
|
export interface Feature {
|
|
48
|
-
/**
|
|
49
|
-
* Modules to be included in this feature in their IDs.
|
|
50
|
-
* The ID of a module is its relative path(no extension) under /exports/.
|
|
48
|
+
/**
|
|
49
|
+
* Modules to be included in this feature in their IDs.
|
|
50
|
+
* The ID of a module is its relative path(no extension) under /exports/.
|
|
51
51
|
*/
|
|
52
52
|
modules: string[];
|
|
53
|
-
/**
|
|
54
|
-
* Flags to set when this feature is enabled.
|
|
53
|
+
/**
|
|
54
|
+
* Flags to set when this feature is enabled.
|
|
55
55
|
*/
|
|
56
56
|
intrinsicFlags?: Record<string, unknown>;
|
|
57
|
-
/**
|
|
58
|
-
* List of uuid that the feature depend on.
|
|
57
|
+
/**
|
|
58
|
+
* List of uuid that the feature depend on.
|
|
59
59
|
*/
|
|
60
60
|
dependentAssets?: string[];
|
|
61
|
-
/**
|
|
62
|
-
* List of module that the feature depend on.
|
|
61
|
+
/**
|
|
62
|
+
* List of module that the feature depend on.
|
|
63
63
|
*/
|
|
64
64
|
dependentModules?: string[];
|
|
65
|
-
/**
|
|
66
|
-
* Whether it is a native only feature, default is false.
|
|
67
|
-
* @default false
|
|
65
|
+
/**
|
|
66
|
+
* Whether it is a native only feature, default is false.
|
|
67
|
+
* @default false
|
|
68
68
|
*/
|
|
69
69
|
isNativeOnly?: boolean;
|
|
70
70
|
}
|
|
@@ -75,42 +75,42 @@ export interface Context {
|
|
|
75
75
|
}
|
|
76
76
|
export type ConstantTypeName = 'boolean' | 'number';
|
|
77
77
|
export interface IConstantInfo {
|
|
78
|
-
/**
|
|
79
|
-
* The comment of the constant.
|
|
80
|
-
* Which is used to generate the consts.d.ts file.
|
|
78
|
+
/**
|
|
79
|
+
* The comment of the constant.
|
|
80
|
+
* Which is used to generate the consts.d.ts file.
|
|
81
81
|
*/
|
|
82
82
|
readonly comment: string;
|
|
83
|
-
/**
|
|
84
|
-
* The type of the constant for generating consts.d.ts file.
|
|
83
|
+
/**
|
|
84
|
+
* The type of the constant for generating consts.d.ts file.
|
|
85
85
|
*/
|
|
86
86
|
readonly type: ConstantTypeName;
|
|
87
|
-
/**
|
|
88
|
-
* The default value of the constant.
|
|
89
|
-
* It can be a boolean, number or string.
|
|
90
|
-
* When it's a string type, the value is the result of eval().
|
|
87
|
+
/**
|
|
88
|
+
* The default value of the constant.
|
|
89
|
+
* It can be a boolean, number or string.
|
|
90
|
+
* When it's a string type, the value is the result of eval().
|
|
91
91
|
*/
|
|
92
92
|
value: boolean | string | number;
|
|
93
|
-
/**
|
|
94
|
-
* Whether exported to global as a `CC_XXXX` constant.
|
|
95
|
-
* eg. WECHAT is exported to global.CC_WECHAT
|
|
96
|
-
* NOTE: this is a feature of compatibility with Cocos 2.x engine.
|
|
97
|
-
* Default is false.
|
|
98
|
-
*
|
|
99
|
-
* @default false
|
|
93
|
+
/**
|
|
94
|
+
* Whether exported to global as a `CC_XXXX` constant.
|
|
95
|
+
* eg. WECHAT is exported to global.CC_WECHAT
|
|
96
|
+
* NOTE: this is a feature of compatibility with Cocos 2.x engine.
|
|
97
|
+
* Default is false.
|
|
98
|
+
*
|
|
99
|
+
* @default false
|
|
100
100
|
*/
|
|
101
101
|
ccGlobal?: boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Whether exported to developer.
|
|
104
|
-
* If true, it's only exported to engine.
|
|
102
|
+
/**
|
|
103
|
+
* Whether exported to developer.
|
|
104
|
+
* If true, it's only exported to engine.
|
|
105
105
|
*/
|
|
106
106
|
readonly internal: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Some constant can't specify the value in the Editor, Preview or Test environment,
|
|
109
|
-
* so we need to dynamically judge them in runtime.
|
|
110
|
-
* These values are specified in a helper called `helper-dynamic-constants.ts`.
|
|
111
|
-
* Default is false.
|
|
112
|
-
*
|
|
113
|
-
* @default false
|
|
107
|
+
/**
|
|
108
|
+
* Some constant can't specify the value in the Editor, Preview or Test environment,
|
|
109
|
+
* so we need to dynamically judge them in runtime.
|
|
110
|
+
* These values are specified in a helper called `helper-dynamic-constants.ts`.
|
|
111
|
+
* Default is false.
|
|
112
|
+
*
|
|
113
|
+
* @default false
|
|
114
114
|
*/
|
|
115
115
|
dynamic?: boolean;
|
|
116
116
|
}
|
|
@@ -118,12 +118,12 @@ export interface IConstantConfig {
|
|
|
118
118
|
[ConstantName: string]: IConstantInfo;
|
|
119
119
|
}
|
|
120
120
|
export interface IOptimizeDecorators {
|
|
121
|
-
/**
|
|
122
|
-
* The decorators which should be optimized when they only decorate class fields.
|
|
121
|
+
/**
|
|
122
|
+
* The decorators which should be optimized when they only decorate class fields.
|
|
123
123
|
*/
|
|
124
124
|
fieldDecorators: string[];
|
|
125
|
-
/**
|
|
126
|
-
* The decorators which should be removed directly when they only work in Cocos Creator editor.
|
|
125
|
+
/**
|
|
126
|
+
* The decorators which should be removed directly when they only work in Cocos Creator editor.
|
|
127
127
|
*/
|
|
128
128
|
editorDecorators: string[];
|
|
129
129
|
}
|