Files
cocos4/scripts/build-declarations.js
llsansun 2157fd176d Multithreading (#322)
* worker pool

* opt

* backup

* worker and worker backend

* worker fallback

* opt

* opt

* remove meta

* opt

* worker export

* testcase fix

* worker js template

* worker pal

* worker opt

* test

* Replace error messages with error codes

* Package size reduction

* Package size reduction

* revert

* Restore editor asset .meta files to the base branch state

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014HAtWwr4dy5azfpccweh1g

* bugfix

* Split into two features: Worker and Worker Pool

* worker option

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 16:35:14 +08:00

25 lines
668 B
JavaScript

require('./ensure-pal.cjs')();
const { join } = require('path');
const { emptyDir } = require('fs-extra');
const { dtsBundler } = require('@cocos/ccbuild');
const { magenta } = require('chalk');
const prefix = ''.padStart(20, '=');
console.log(magenta(`${prefix} Build declarations ${prefix}`));
(async function exec () {
const PATHS = {
engine: join(__dirname, '..'),
out: join(__dirname, '..', 'bin', '.declarations'),
};
await emptyDir(PATHS.out);
await dtsBundler.build({
engine: PATHS.engine,
outDir: PATHS.out,
withIndex: true,
withExports: false,
withEditorExports: true,
});
}());