mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
e00a0da0ac
* Optimize .d.ts generation; prepare for sub modules * Fix no emit
23 lines
825 B
JavaScript
23 lines
825 B
JavaScript
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
|
|
const { generate } = require('./generate-declarations');
|
|
const fs = require('fs-extra');
|
|
|
|
const outDir = './bin/.declarations';
|
|
(async () => {
|
|
const options = {
|
|
outDir,
|
|
};
|
|
if (!process.argv.some((arg) => arg.startsWith('--with'))) {
|
|
options.withIndex = true;
|
|
options.withExports = false;
|
|
options.withEditorExports = false;
|
|
} else {
|
|
options.withIndex = !!process.argv.includes('--with-index');
|
|
options.withExports = !!process.argv.includes('--with-exports');
|
|
options.withEditorExports = !!process.argv.includes('--with-editor-exports');
|
|
}
|
|
await fs.emptyDir(outDir);
|
|
await generate(options);
|
|
})(); |