mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
1c737b91fd
* publish build-engine 4.3.5 * update build-engine deps * remove default-constants.ts ds remove de * delete consts.d.ts * support build-const workflow * remove EXPORT_TO_GLOBAL * update comment * fix interface-check * update comment
15 lines
526 B
JavaScript
15 lines
526 B
JavaScript
const { StatsQuery } = require('@cocos/build-engine');
|
|
const ps = require('path');
|
|
const fsExt = require('fs-extra');
|
|
const chalk = require('chalk').default;
|
|
|
|
const engineRoot = ps.join(__dirname, '../');
|
|
const targetConstFile = ps.join(engineRoot, `./@types/consts.d.ts`);
|
|
|
|
console.log(chalk.green(`\nGenerate consts.d.ts: ${targetConstFile}\n`));
|
|
|
|
StatsQuery.create(engineRoot).then(statsQuery => {
|
|
const ic = statsQuery.constantManager.genInternalConstants();
|
|
fsExt.outputFileSync(targetConstFile, ic, 'utf8');
|
|
});
|