Skip to content

Commit

Permalink
Rename to scripts/test-build-cocos.js
Browse files Browse the repository at this point in the history
  • Loading branch information
dumganhar committed Sep 19, 2024
1 parent 3e6cbc1 commit ff2e5a2
Showing 1 changed file with 11 additions and 30 deletions.
41 changes: 11 additions & 30 deletions scripts/build-h5-source.js → scripts/test-build-cocos.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,22 @@
const ps = require('path');
const { ensureDir, emptyDir } = require('fs-extra');
const { magenta } = require('chalk');

const { buildEngine } = require('../lib/src');

const prefix = ''.padStart(20, '=');
console.log(magenta(`${prefix} Build H5 source ${prefix}`));
const argv = process.argv;

(async function exec () {
if (argv.length <= 2) {
console.error(`Usages: node test-build-cocos.js cocos_engine_absolute_path`);
return;
}

const enginePath = argv[2];
console.info(`>>> enginePath: ${enginePath}`);

(async function exec () {
const outDir = ps.join(__dirname, '..', 'build-cc-out');

// const options = {
// "engine": "/Users/james/projects/cocos-creator/cocos-editor/resources/3d/engine",
// "out": outDir,
// "platform": "HTML5",
// "moduleFormat": "system",
// "compress": true,
// "split": false,
// "nativeCodeBundleMode": "wasm",
// "assetURLFormat": "runtime-resolved",
// "noDeprecatedFeatures": false,
// "sourceMap": false,
// "features": ["2d", "3d", "animation", "audio", "base", "debug-renderer", "dragon-bones", "geometry-renderer", "gfx-webgl", "intersection-2d", "legacy-pipeline", "light-probe", "particle", "particle-2d", "physics-2d-builtin", "physics-cannon", "primitive", "profiler", "skeletal-animation", "spine", "terrain", "tiled-map", "tween", "ui", "video", "websocket", "webview"],
// "loose": true,
// "mode": "BUILD",
// "flags": {
// "DEBUG": false,
// "WEBGPU": false
// },
// "wasmCompressionMode": false,
// "visualize": true,
// "inlineEnum": true,
// };

const options = {
"engine": "/Users/james/projects/cocos-creator/cocos-editor-3/resources/3d/engine",
"engine": enginePath,
"out": outDir,
"platform": "WECHAT",
"moduleFormat": "system",
Expand All @@ -46,12 +26,13 @@ console.log(magenta(`${prefix} Build H5 source ${prefix}`));
"assetURLFormat": "relative-from-out",
"noDeprecatedFeatures": true,
"sourceMap": false,
// "features":["2d","base","gfx-webgl","legacy-pipeline","profiler","tween","ui"],
// "features": ["2d", "3d", "animation", "audio", "base", "debug-renderer", "dragon-bones", "geometry-renderer", "gfx-webgl", "intersection-2d", "legacy-pipeline", "light-probe", "particle", "particle-2d", "physics-2d-builtin", "physics-cannon", "primitive", "profiler", "skeletal-animation", "spine", "terrain", "tiled-map", "tween", "ui", "video", "websocket", "webview"],
"features":["gfx-webgl2"],
"loose": true,
"mode": "BUILD",
"flags": {
"DEBUG": false,
"WEBGPU": false
},
// "metaFile": ps.join(outDir, "meta.json"),
// "incremental": ps.join(outDir, "watch-files.json"),
Expand Down

0 comments on commit ff2e5a2

Please sign in to comment.