build: add solution and client bundling scripts
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { spawnSync } from 'node:child_process'
|
||||
import { dirname, resolve } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
|
||||
|
||||
function run(command) {
|
||||
console.log(`\n> ${command}`)
|
||||
const result = spawnSync(command, { cwd: root, stdio: 'inherit', shell: true })
|
||||
if (result.status !== 0) {
|
||||
console.error(`\n[build] Command failed: ${command}`)
|
||||
process.exit(result.status ?? 1)
|
||||
}
|
||||
}
|
||||
|
||||
run('npm --prefix client run build')
|
||||
run('node scripts/copy-client.mjs')
|
||||
run('dotnet build HubMi.slnx --configuration Release')
|
||||
|
||||
console.log('\n[build] Done.')
|
||||
Reference in New Issue
Block a user