17 lines
600 B
JavaScript
17 lines
600 B
JavaScript
import { execSync } from 'node:child_process'
|
|
import { existsSync } from 'node:fs'
|
|
import path from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
|
|
process.chdir(root)
|
|
|
|
execSync('node scripts/write-docker-vite-env.mjs', { stdio: 'inherit' })
|
|
execSync('npm run build-only', { stdio: 'inherit' })
|
|
|
|
if (!existsSync(path.join(root, 'dist', 'index.html'))) {
|
|
throw new Error('dist/index.html ساخته نشد')
|
|
}
|
|
|
|
console.log('dist آماده است. commit و push کنید تا Dokploy بدون npm سرو کند.')
|