feat(runner): updated the way runner works
This commit is contained in:
22
libs/exec.js
22
libs/exec.js
@@ -1,12 +1,28 @@
|
||||
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(`O=${key} node runner.js && O=${key} pnpm run build`).toString());
|
||||
console.log(execSync(`node runner.js --build ${key}`).toString());
|
||||
}
|
||||
}
|
||||
|
||||
export function runDev(config) {
|
||||
|
||||
export function runDev(rootDir) {
|
||||
; (async () => {
|
||||
const server = await createServer({
|
||||
root: rootDir,
|
||||
})
|
||||
await server.listen()
|
||||
|
||||
server.printUrls()
|
||||
})()
|
||||
}
|
||||
|
||||
export function runBuild(rootDir) {
|
||||
; (async () => {
|
||||
await build({
|
||||
root: rootDir,
|
||||
})
|
||||
})()
|
||||
}
|
||||
Reference in New Issue
Block a user