mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-19 21:06:06 +08:00
32 lines
779 B
JavaScript
32 lines
779 B
JavaScript
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
import { build as buildVite } from 'vite';
|
|
import fse from 'fs-extra';
|
|
import minimist from 'minimist';
|
|
|
|
import resViteConfig from './vite.res.config.mjs';
|
|
|
|
const args = minimist(process.argv.slice(2));
|
|
|
|
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
const buildList = [];
|
|
|
|
if (args.type === 'res' || args.type === 'all') {
|
|
fse.removeSync(path.resolve(dirname, '../dist/entry'));
|
|
|
|
for (const mode of ['value', 'config', 'event', 'ds:value', 'ds:config', 'ds:event']) {
|
|
buildList.push(
|
|
buildVite({
|
|
root: path.resolve(dirname, '../'),
|
|
clearScreen: false,
|
|
configFile: false,
|
|
...resViteConfig(mode),
|
|
}),
|
|
);
|
|
}
|
|
}
|
|
|
|
Promise.all(buildList);
|