angular - 如何更改heroku的node.js buildpack以运行构建以外的脚本
问题描述
我有一个应用程序 foobar,它的文件结构是这样的:
- /客户
- /api
- 包.json
我的 package.json 看起来像这样:
"scripts": {
"start": "node server",
"start-local": "nodemon server NODE_ENV=local",
"start-dev": "nodemon server NODE_ENV=dev ",
"start-stage": "nodemon server NODE_ENV=stage",
"build": "cd Client/ && npm install && npm run build",
"build-stage": "cd Client/ && npm install && npm run build-stage",
"build-dev": "cd Client/ && npm install && npm run build-dev"
},
Client 中的 package.json 如下所示:
"scripts": {
"ng": "ng",
"start-dev": "ng serve --open --configuration development",
"build": "ng build",
"build-stage": "ng build --configuration=staging",
"build-dev": "ng build --watch --configuration development",
"test": "ng test"
},
我目前已将应用程序部署在 heroku 上。我有两个应用程序:foobar-stage 和 foobar。我正在使用 node.js 构建包。我在客户端和 api 的不同 env 文件中为(dev、stage & prod)设置了不同的配置值。foobar 应用程序在 heroku 上部署良好,但 foobar-stage 应用程序,尽管我将 NODE_ENV 更改为 stage 运行构建命令。
如何告诉 heroku 为 foobar-stage 运行 build-stage 命令?
解决方案
推荐阅读
- mysql - 如何在子查询 WHERE 子句中重用变量?
- php - 跟踪重定向 URL 状态(成功、拒绝)
- javascript - Javascript打字稿将特殊字符附加到字符串不起作用
- java - 拆分和合并重叠的日期时间间隔
- python - Python 垃圾箱每 20 分钟
- android - 如果没有创建 Geofire,我如何检查 Geofire 以注销用户?
- casting - 我无法使用 ValueInjecter 在我的实体框架查询中直接转换对象
- java - 如何处理这个 ArraystoreException 元素类型不匹配?
- python - Matplotlib:如何绘制这个?可能吗?
- c# - 从 2 个登录字段获取主键