fix: prepend node_modules/.bin to PATH for ng in CI
continuous-integration/drone/push Build is failing
continuous-integration/drone/push Build is failing
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+1
-2
@@ -9,8 +9,7 @@
|
|||||||
"watch": "ng build --watch --configuration development",
|
"watch": "ng build --watch --configuration development",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"serve:ssr": "node scripts/serve-ssr.js",
|
"serve:ssr": "node scripts/serve-ssr.js",
|
||||||
"server:build": "ng run goals-tracker:server:production",
|
"build:ssr": "bun run build:prod",
|
||||||
"build:ssr": "bun run build:prod && bun run server:build",
|
|
||||||
"prerender": "ng run goals-tracker:prerender"
|
"prerender": "ng run goals-tracker:prerender"
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
@@ -4,5 +4,11 @@
|
|||||||
* Use for production build so process.env is populated for environment.prod.ts.
|
* Use for production build so process.env is populated for environment.prod.ts.
|
||||||
*/
|
*/
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
|
const path = require('path');
|
||||||
const { execSync } = require('child_process');
|
const { execSync } = require('child_process');
|
||||||
execSync('bun run build', { stdio: 'inherit', cwd: process.cwd(), shell: true });
|
const binDir = path.join(process.cwd(), 'node_modules', '.bin');
|
||||||
|
const pathSep = process.platform === 'win32' ? ';' : ':';
|
||||||
|
const pathEnv = binDir + pathSep + (process.env.PATH || '');
|
||||||
|
const env = { ...process.env, PATH: pathEnv };
|
||||||
|
execSync('ng build', { stdio: 'inherit', env });
|
||||||
|
execSync('ng run goals-tracker:server:production', { stdio: 'inherit', env });
|
||||||
|
|||||||
Reference in New Issue
Block a user