diff --git a/package.json b/package.json index 595169a..251e559 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "watch": "ng build --watch --configuration development", "test": "jest", "serve:ssr": "node scripts/serve-ssr.js", - "build:ssr": "bun run build:prod", + "build:ssr": "bun run build:prod && bunx ng run goals-tracker:server:production", "prerender": "ng run goals-tracker:prerender" }, "private": true, diff --git a/scripts/build-with-env.js b/scripts/build-with-env.js index f5f5c40..81d8ceb 100644 --- a/scripts/build-with-env.js +++ b/scripts/build-with-env.js @@ -1,11 +1,8 @@ #!/usr/bin/env node /** - * Loads .env and runs ng build + server build. + * Loads .env and runs ng build. * Use for production build so process.env is populated for environment.prod.ts. */ require('dotenv').config(); const { execSync } = require('child_process'); -const { join } = require('path'); -const ngPath = join(process.cwd(), 'node_modules', '.bin', 'ng'); -execSync(`"${ngPath}" build`, { stdio: 'inherit' }); -execSync(`"${ngPath}" run goals-tracker:server:production`, { stdio: 'inherit' }); +execSync('bunx ng build', { stdio: 'inherit' });