如何在 heroku 平台上将 Procfile 用于我的反应应用程序



我正在使用 react 并且我需要在 Heroku 平台上上传我的项目,所以我尝试在 Heroku 上上传并Error R14 (Memory quota exceeded)此错误,我读到此错误,所以我创建了一个文件 procfile 并添加了:

web: node --optimize_for_size --max_old_space_size=920 --gc_interval=100 server.js

但是现在它产生了一个新问题Error: Cannot find module '/app/server.js那么我该怎么做才能解决这个问题?

in Procfile

web: react-scripts --optimize_for_size --max_old_space_size=920 --gc_interval=100 start

在包中.json

"scripts": {
"start": "react-scripts --optimize_for_size --max_old_space_size=920 --gc_interval=100 start",
"build": "react-scripts --optimize_for_size --max_old_space_size=920 --gc_interval=100 build",
}

最新更新