mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-18 11:30:05 +08:00
31 lines
720 B
JavaScript
31 lines
720 B
JavaScript
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
import { build as buildVite } from 'vite';
|
|
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 = [];
|
|
|
|
const buildRes = args.type === 'res' || args.type === 'all';
|
|
|
|
if (buildRes) {
|
|
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);
|