@cocos/ccbuild 1.1.18 → 1.1.20
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 +12 -0
- package/README.md +37 -37
- package/lib/api-builder.js +1 -1
- package/lib/build-engine/engine-js/index.d.ts +2 -2
- package/lib/build-engine/engine-js/index.js +406 -406
- package/lib/build-engine/engine-js/rollup-plugins/external-wasm-loader.d.ts +57 -57
- package/lib/build-engine/engine-js/rollup-plugins/external-wasm-loader.d.ts.map +1 -1
- package/lib/build-engine/engine-js/rollup-plugins/external-wasm-loader.js +326 -323
- package/lib/build-engine/engine-js/rollup-plugins/external-wasm-loader.js.map +1 -1
- package/lib/build-engine/engine-js/rollup-plugins/remove-deprecated-features.d.ts +2 -2
- package/lib/build-engine/engine-js/rollup-plugins/remove-deprecated-features.js +37 -37
- package/lib/build-engine/engine-js/rollup-plugins/ts-paths.d.ts +4 -4
- package/lib/build-engine/engine-js/rollup-plugins/ts-paths.js +42 -42
- package/lib/build-engine/engine-ts/engine-builder.d.ts +57 -57
- package/lib/build-engine/engine-ts/engine-builder.js +631 -631
- package/lib/build-engine/engine-ts/field-decorator-helper.d.ts +9 -9
- package/lib/build-engine/engine-ts/field-decorator-helper.js +54 -54
- package/lib/build-engine/engine-ts/index.d.ts +2 -2
- package/lib/build-engine/engine-ts/index.js +36 -36
- package/lib/build-engine/engine-ts/plugins/external-wasm-loader.d.ts +6 -6
- package/lib/build-engine/engine-ts/plugins/external-wasm-loader.js +65 -65
- package/lib/build-engine/engine-ts/plugins/interface.d.ts +20 -20
- package/lib/build-engine/engine-ts/plugins/interface.js +1 -1
- package/lib/build-engine/index.d.ts +147 -145
- package/lib/build-engine/index.d.ts.map +1 -1
- package/lib/build-engine/index.js +168 -167
- package/lib/build-engine/index.js.map +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.js +33 -33
- package/lib/module-resolver.d.ts +7 -7
- package/lib/module-resolver.js +28 -28
- package/lib/stats-query/config-interface.d.ts +129 -129
- package/lib/stats-query/config-interface.js +3 -3
- package/lib/stats-query/index.d.ts +183 -183
- package/lib/stats-query/index.js +531 -531
- package/lib/stats-query/path-utils.d.ts +2 -2
- package/lib/stats-query/path-utils.js +35 -35
- package/lib/transformer/babel.d.ts +5 -5
- package/lib/transformer/babel.js +34 -34
- package/lib/transformer/index.d.ts +2 -2
- package/lib/transformer/index.js +28 -28
- package/lib/utils.d.ts +4 -4
- package/lib/utils.js +23 -23
- package/package.json +1 -1
- 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 +20227 -20227
|
@@ -1,146 +1,148 @@
|
|
|
1
|
-
import { StatsQuery } from "../stats-query";
|
|
2
|
-
export declare function buildEngine(options: buildEngine.Options): Promise<buildEngine.Result>;
|
|
3
|
-
export declare namespace buildEngine {
|
|
4
|
-
type ModuleFormat = 'esm' | 'cjs' | 'system' | 'iife';
|
|
5
|
-
interface Options {
|
|
6
|
-
/**
|
|
7
|
-
* 引擎仓库目录。
|
|
8
|
-
*/
|
|
9
|
-
engine: string;
|
|
10
|
-
/**
|
|
11
|
-
* 输出目录。
|
|
12
|
-
*/
|
|
13
|
-
out: string;
|
|
14
|
-
mode: StatsQuery.ConstantManager.ModeType;
|
|
15
|
-
platform: StatsQuery.ConstantManager.PlatformType;
|
|
16
|
-
flags?: Partial<StatsQuery.ConstantManager.IFlagConfig>;
|
|
17
|
-
/**
|
|
18
|
-
* 包含的功能。
|
|
19
|
-
*/
|
|
20
|
-
features?: string[];
|
|
21
|
-
/**
|
|
22
|
-
* 输出模块格式。
|
|
23
|
-
* @default 'system'
|
|
24
|
-
*/
|
|
25
|
-
moduleFormat?: ModuleFormat;
|
|
26
|
-
/**
|
|
27
|
-
* 是否对生成结果进行压缩。
|
|
28
|
-
* @default false
|
|
29
|
-
*/
|
|
30
|
-
compress?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* 是否生成 source map。
|
|
33
|
-
* 若为 `inline` 则生成内联的 source map。
|
|
34
|
-
* @default false
|
|
35
|
-
*/
|
|
36
|
-
sourceMap?: boolean | 'inline';
|
|
37
|
-
/**
|
|
38
|
-
* 若 `sourceMap` 为 `true`,此选项指定了 source map 的路径。
|
|
39
|
-
* @default `${outputPath.map}`
|
|
40
|
-
*/
|
|
41
|
-
sourceMapFile?: string;
|
|
42
|
-
/**
|
|
43
|
-
* 若为 `true`,分割出 **所有** 引擎子模块。
|
|
44
|
-
* 否则,`.moduleEntries` 指定的所有子模块将被合并成一个单独的 `"cc"` 模块。
|
|
45
|
-
* @default false
|
|
46
|
-
*/
|
|
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
|
|
61
|
-
*/
|
|
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
|
|
67
|
-
*/
|
|
68
|
-
noDeprecatedFeatures?: string | boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Experimental.
|
|
71
|
-
*/
|
|
72
|
-
incremental?: string;
|
|
73
|
-
/**
|
|
74
|
-
* BrowsersList targets.
|
|
75
|
-
*/
|
|
76
|
-
targets?: string | string[] | Record<string, string>;
|
|
77
|
-
/**
|
|
78
|
-
* Enable loose compilation.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
*
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* @
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
*
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
1
|
+
import { StatsQuery } from "../stats-query";
|
|
2
|
+
export declare function buildEngine(options: buildEngine.Options): Promise<buildEngine.Result>;
|
|
3
|
+
export declare namespace buildEngine {
|
|
4
|
+
type ModuleFormat = 'esm' | 'cjs' | 'system' | 'iife';
|
|
5
|
+
interface Options {
|
|
6
|
+
/**
|
|
7
|
+
* 引擎仓库目录。
|
|
8
|
+
*/
|
|
9
|
+
engine: string;
|
|
10
|
+
/**
|
|
11
|
+
* 输出目录。
|
|
12
|
+
*/
|
|
13
|
+
out: string;
|
|
14
|
+
mode: StatsQuery.ConstantManager.ModeType;
|
|
15
|
+
platform: StatsQuery.ConstantManager.PlatformType;
|
|
16
|
+
flags?: Partial<StatsQuery.ConstantManager.IFlagConfig>;
|
|
17
|
+
/**
|
|
18
|
+
* 包含的功能。
|
|
19
|
+
*/
|
|
20
|
+
features?: string[];
|
|
21
|
+
/**
|
|
22
|
+
* 输出模块格式。
|
|
23
|
+
* @default 'system'
|
|
24
|
+
*/
|
|
25
|
+
moduleFormat?: ModuleFormat;
|
|
26
|
+
/**
|
|
27
|
+
* 是否对生成结果进行压缩。
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
compress?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* 是否生成 source map。
|
|
33
|
+
* 若为 `inline` 则生成内联的 source map。
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
sourceMap?: boolean | 'inline';
|
|
37
|
+
/**
|
|
38
|
+
* 若 `sourceMap` 为 `true`,此选项指定了 source map 的路径。
|
|
39
|
+
* @default `${outputPath.map}`
|
|
40
|
+
*/
|
|
41
|
+
sourceMapFile?: string;
|
|
42
|
+
/**
|
|
43
|
+
* 若为 `true`,分割出 **所有** 引擎子模块。
|
|
44
|
+
* 否则,`.moduleEntries` 指定的所有子模块将被合并成一个单独的 `"cc"` 模块。
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
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
|
|
61
|
+
*/
|
|
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
|
|
67
|
+
*/
|
|
68
|
+
noDeprecatedFeatures?: string | boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Experimental.
|
|
71
|
+
*/
|
|
72
|
+
incremental?: string;
|
|
73
|
+
/**
|
|
74
|
+
* BrowsersList targets.
|
|
75
|
+
*/
|
|
76
|
+
targets?: string | string[] | Record<string, string>;
|
|
77
|
+
/**
|
|
78
|
+
* Enable loose compilation.
|
|
79
|
+
*
|
|
80
|
+
* @deprecated since 1.1.20, we force using true internal.
|
|
81
|
+
*/
|
|
82
|
+
loose?: boolean;
|
|
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.
|
|
94
|
+
*/
|
|
95
|
+
assetURLFormat?: 'relative-from-out' | 'relative-from-chunk' | 'runtime-resolved';
|
|
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
|
|
101
|
+
*/
|
|
102
|
+
preserveType?: boolean;
|
|
103
|
+
}
|
|
104
|
+
interface Result {
|
|
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
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
exports: Record<string, string>;
|
|
115
|
+
/**
|
|
116
|
+
* The compulsory import mappings that should be applied.
|
|
117
|
+
*/
|
|
118
|
+
chunkAliases: Record<string, string>;
|
|
119
|
+
/**
|
|
120
|
+
* The dependency graph, only including dependency chunks.
|
|
121
|
+
*
|
|
122
|
+
* @deprecated please use `chunkDepGraph` instead.
|
|
123
|
+
*/
|
|
124
|
+
dependencyGraph?: Record<string, string[]>;
|
|
125
|
+
chunkDepGraph: Record<string, string[]>;
|
|
126
|
+
assetDepGraph: Record<string, string[]>;
|
|
127
|
+
hasCriticalWarns: boolean;
|
|
128
|
+
}
|
|
129
|
+
function transform(code: string, moduleOption: ModuleFormat, loose?: boolean): Promise<{
|
|
130
|
+
code: string;
|
|
131
|
+
}>;
|
|
132
|
+
function isSourceChanged(incrementalFile: string): Promise<boolean>;
|
|
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.
|
|
139
|
+
*/
|
|
140
|
+
function enumerateDependentChunks(meta: buildEngine.Result, featureUnits: string[]): string[];
|
|
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.
|
|
145
|
+
*/
|
|
146
|
+
function enumerateAllDependents(meta: buildEngine.Result, featureUnits: string[]): string[];
|
|
147
|
+
}
|
|
146
148
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/build-engine/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/build-engine/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAgB5C,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,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;QAExD;;WAEG;QACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QAEpB;;;WAGG;QACH,YAAY,CAAC,EAAE,YAAY,CAAC;QAE5B;;;WAGG;QACH,QAAQ,CA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