26 lines
603 B
JavaScript
26 lines
603 B
JavaScript
import { execSync } from 'child_process'
|
|
import { createServer, build } from 'vite'
|
|
|
|
export function buildAll(config) {
|
|
for (const [key, _] of Object.entries(config.operators)) {
|
|
if (key.startsWith('_')) break;
|
|
console.log(execSync(`node runner.js build ${key}`).toString());
|
|
}
|
|
}
|
|
|
|
export function runDev(rootDir) {
|
|
; (async () => {
|
|
const server = await createServer({
|
|
root: rootDir,
|
|
})
|
|
await server.listen()
|
|
|
|
server.printUrls()
|
|
})()
|
|
}
|
|
|
|
export async function runBuild(rootDir) {
|
|
await build({
|
|
root: rootDir,
|
|
})
|
|
} |