11 lines
282 B
JavaScript
11 lines
282 B
JavaScript
import fs from 'node:fs';
|
|
import { spawnSync } from 'node:child_process';
|
|
|
|
if (fs.existsSync('dist/index.html')) {
|
|
process.exit(0);
|
|
}
|
|
|
|
const result = spawnSync(process.execPath, ['node_modules/vite/bin/vite.js', 'build'], { stdio: 'inherit' });
|
|
|
|
process.exit(result.status ?? 1);
|