gpt4 book ai didi

javascript - create-react-app npm run start 在生产模式下。也许不可能?

转载 作者:数据小太阳 更新时间:2023-10-29 04:21:47 25 4
gpt4 key购买 nike

我需要像简单地那样运行服务器:

npm 运行开始

但我需要使用生产模式。这可能吗?

在 ember 或 angular 中是可能的。在 create-react-app 中怎么做?

我尝试了 npm run start --prod 但没有。

最佳答案

最好的选择可能是进行正常的生产构建,然后在本地运行。
首先安装一个HTTP服务器:

npm install serve -g

然后:

npm run build
serve -s build

默认情况下,它将在端口 5000 上运行,因此您的本地 URL 是 http://localhost:5000

关于javascript - create-react-app npm run start 在生产模式下。也许不可能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49341084/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com