This commit is contained in:
Heidi
2026-05-14 21:02:17 +01:00
parent c165c97d9c
commit ba487d1f8b
2 changed files with 26 additions and 6 deletions
+18 -5
View File
@@ -97,6 +97,23 @@ function run(command, args, options = {}) {
})
}
async function ensureBuildDependencies() {
await run('npm', ['install', '--production=false', '--include=dev', '--omit=optional'], {
env: {
NODE_ENV: 'development',
npm_config_include: 'dev',
npm_config_omit: 'optional',
npm_config_production: 'false',
},
})
try {
require.resolve('@vitejs/plugin-react')
} catch {
throw new Error('@vitejs/plugin-react is missing after npm install; dev dependencies were not installed')
}
}
function postDiscordWebhook(payload) {
if (!DISCORD_WEBHOOK_URL) return Promise.resolve()
@@ -162,11 +179,7 @@ function notifyDiscordRestart() {
async function deploy() {
await run('git', ['pull', '--ff-only'])
await run('npm', ['install', '--include=dev'], {
env: {
npm_config_production: 'false',
},
})
await ensureBuildDependencies()
await run('npm', ['run', 'build'])
for (const target of RESTART_TARGETS) {