diff --git a/cc.config.json b/cc.config.json index 16b26d545d..1766b04e83 100644 --- a/cc.config.json +++ b/cc.config.json @@ -26,6 +26,9 @@ }, "3d": { "modules": ["3d"], + "overrideConstants": { + "USE_3D": true + }, "dependentAssets": [ "511d2633-09a7-4bdd-ac42-f778032124b3", "5d45aa00-e064-4938-b314-4265f0c2258c", @@ -68,6 +71,9 @@ }, "ui-skew": { "modules": ["ui-skew"], + "overrideConstants": { + "USE_UI_SKEW": true + }, "dependentModules": ["2d"] }, "ui": { @@ -159,7 +165,10 @@ "modules": ["video"] }, "xr": { - "modules": ["xr"] + "modules": ["xr"], + "overrideConstants": { + "USE_XR": true + } }, "light-probe": { "modules": [ "light-probe" ] @@ -259,7 +268,10 @@ "isNativeOnly": true }, "meshopt": { - "modules": [] + "modules": [], + "overrideConstants": { + "CULL_MESHOPT": false + } } }, "moduleOverrides": [{ @@ -722,13 +734,19 @@ "USE_3D": { "comment": "An internal constant to indicate whether we're using 3d module.", "type": "boolean", - "value": true, + "value": false, "internal": true }, "USE_UI_SKEW": { "comment": "An internal constant to indicate whether we're using ui-skew module.", "type": "boolean", - "value": true, + "value": false, + "internal": true + }, + "USE_XR": { + "comment": "An internal constant to indicate whether we're using xr module.", + "type": "boolean", + "value": false, "internal": true } }, diff --git a/cc.config.schema.json b/cc.config.schema.json index 22fb1a4a3e..45b2f5f1d4 100644 --- a/cc.config.schema.json +++ b/cc.config.schema.json @@ -118,6 +118,16 @@ "type": "string" }, "type": "array" + }, + "overrideConstants": { + "additionalProperties": { + "type": [ + "number", + "boolean" + ] + }, + "description": "Constants to override when this feature is enabled. The overridden constants should be defined in cc.config.json.", + "type": "object" } }, "required": [ diff --git a/package-lock.json b/package-lock.json index 51bb405b2c..77d9c61e02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@babel/plugin-proposal-class-properties": "^7.18.6", "@cocos/box2d": "1.0.1", "@cocos/cannon": "1.2.8", - "@cocos/ccbuild": "^2.3.10", + "@cocos/ccbuild": "^2.3.13", "@cocos/dragonbones-js": "^1.0.1" }, "devDependencies": { @@ -2063,9 +2063,13 @@ } }, "node_modules/@cocos/ccbuild": { - "version": "2.3.10", - "resolved": "https://registry.npmjs.org/@cocos/ccbuild/-/ccbuild-2.3.10.tgz", - "integrity": "sha512-paleC8syjqEtxmH3PU5NaI87x/YJ1ANTZbQNENOZ3SY90nvhl6Vj6AkD8AcNnR96klUS0Sh2t5YbZkPGT7LDAQ==", + "version": "2.3.13", + "resolved": "https://registry.npmjs.org/@cocos/ccbuild/-/ccbuild-2.3.13.tgz", + "integrity": "sha512-NxMCiulV2M6Hy5xyVEz1brIXcDNA/m7XdjoZ2iVDrVgIi3z/8CZ/3ljG4v4j+8eQAuSPNvOugScLiIMkLvuWeg==", + "license": "MIT", + "workspaces": [ + "./modules/*" + ], "dependencies": { "@babel/core": "^7.20.12", "@babel/generator": "^7.22.10", diff --git a/package.json b/package.json index a679a48101..d27baefe5e 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "@babel/plugin-proposal-class-properties": "^7.18.6", "@cocos/box2d": "1.0.1", "@cocos/cannon": "1.2.8", - "@cocos/ccbuild": "^2.3.10", + "@cocos/ccbuild": "^2.3.13", "@cocos/dragonbones-js": "^1.0.1" } }