简体   繁体   English

在 Heroku 上部署 Vite React 应用程序时遇到问题

[英]Having problems with deploying Vite React app on Heroku

I'm having problem with my app.我的应用程序有问题。 I've successfully pushed all the files onto the site, but I've discovered that it's starting my app with npm start.我已成功将所有文件推送到网站上,但我发现它以 npm 开始启动我的应用程序。 I need it to use 'npm run dev' instead.我需要它来代替使用“npm run dev”。 heroku 日志 --tail

Easiest way is to create a start script and put the command you want to run in production.最简单的方法是创建一个启动脚本并将要在生产中运行的命令放入。

If you want the same command, put the 'dev' script's code in 'start' script如果您想要相同的命令,请将“dev”脚本的代码放在“start”脚本中

As 'dev' script contains command for development and 'start' should contain production script.由于“dev”脚本包含开发命令,“start”应包含生产脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM