【发布时间】:2022-01-10 20:21:20
【问题描述】:
如果我想部署到 Heroku,我的脚本应该是什么样子?并确保应用程序在生产模式(构建)下运行,所以基本上我将我当前的代码推送到 github 并从 Heroku 部署推送的代码问题是我的应用程序在开发模式下运行并且它完全忽略了构建应用程序出于某种原因知道如何解决这个问题吗?
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
我还希望我的应用程序在欧盟地区运行,但 mars/create-react-app buildpack 将我的应用程序位置设置为美国。
【问题讨论】:
-
或者,如果你的应用是独立的,你可以use the
mars/create-react-appbuildpack。 -
你确定吗?我不相信 buildpacks 负责设置区域。你can set it yourself when creating your app,不过:
heroku create --region eu。一口气:heroku create YOUR_APP_NAME --region eu --buildpack mars/create-react-app.