mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
c41807c4f6
* [Optimize] Simplify workflow
23 lines
649 B
JavaScript
23 lines
649 B
JavaScript
const { join } = require('path');
|
|
const { emptyDir } = require('fs-extra');
|
|
const { build } = require('@cocos/build-engine/dist/build-declarations');
|
|
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 build({
|
|
engine: PATHS.engine,
|
|
outDir: PATHS.out,
|
|
withIndex: true,
|
|
withExports: false,
|
|
withEditorExports: true,
|
|
});
|
|
}());
|