build: add solution and client bundling scripts

This commit is contained in:
Rafał Tyński
2026-10-03 18:30:39 +02:00
parent 04ac25eae4
commit 74f14e93ea
3 changed files with 43 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import { cpSync, existsSync, mkdirSync, rmSync } from 'node:fs'
import { dirname, join, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
const source = join(root, 'client', 'dist')
const target = join(root, 'backend', 'wwwroot')
if (!existsSync(source)) {
console.error(`[copy] Build output not found: ${source}. Run "npm run build" in client first.`)
process.exit(1)
}
rmSync(target, { recursive: true, force: true })
mkdirSync(target, { recursive: true })
cpSync(source, target, { recursive: true })
console.log(`[copy] Copied ${source} -> ${target}`)