export interface Config { /** * Engine features. Keys are feature IDs. */ features: Record; /** * Describe how to generate the index module `'cc'`. * Currently not used. */ index?: IndexConfig; moduleOverrides?: Array<{ test: Test; overrides: Record; isVirtualModule: boolean; }>; /** * Included files for quick-compiler. */ includes: Array; /** * The constants config for engine and user. */ constants: IConstantConfig; /** * The decorators to be optimize when build engine. */ optimizeDecorators: IOptimizeDecorators; } export interface IndexConfig { modules?: Record; } export type Test = string; /** * An engine feature. */ export interface Feature { /** * Modules to be included in this feature in their IDs. * The ID of a module is its relative path(no extension) under /exports/. */ modules: string[]; /** * Flags to set when this feature is enabled. */ intrinsicFlags?: Record; /** * List of uuid that the feature depend on. */ dependentAssets?: string[]; /** * List of module that the feature depend on. */ dependentModules?: string[]; /** * Whether it is a native only feature, default is false. * @default false */ isNativeOnly?: boolean; } export interface Context { mode?: string; platform?: string; buildTimeConstants?: Object; } export type ConstantTypeName = 'boolean' | 'number'; export interface IConstantInfo { /** * The comment of the constant. * Which is used to generate the consts.d.ts file. */ readonly comment: string; /** * The type of the constant for generating consts.d.ts file. */ readonly type: ConstantTypeName; /** * The default value of the constant. * It can be a boolean, number or string. * When it's a string type, the value is the result of eval(). */ value: boolean | string | number; /** * Whether exported to global as a `CC_XXXX` constant. * eg. WECHAT is exported to global.CC_WECHAT * NOTE: this is a feature of compatibility with Cocos 2.x engine. * Default is false. * * @default false */ ccGlobal?: boolean; /** * Whether exported to developer. * If true, it's only exported to engine. */ readonly internal: boolean; /** * Some constant can't specify the value in the Editor, Preview or Test environment, * so we need to dynamically judge them in runtime. * These values are specified in a helper called `helper-dynamic-constants.ts`. * Default is false. * * @default false */ dynamic?: boolean; } export interface IConstantConfig { [ConstantName: string]: IConstantInfo; } export interface IOptimizeDecorators { /** * The decorators which should be optimized when they only decorate class fields. */ fieldDecorators: string[]; /** * The decorators which should be removed directly when they only work in Cocos Creator editor. */ editorDecorators: string[]; }