gpt4 book ai didi

javascript - create-react-app 排除文件夹触发重新加载

转载 作者:行者123 更新时间:2023-11-29 15:18:06 26 4
gpt4 key购买 nike

我有一个用例,我在我的公共(public)文件夹中动态存储一个 pdf 文件。public/print-preview/.

这里的问题是在创建和存储这样的文件后,应用程序会重新加载并且状态会丢失。

我怎样才能将这样的文件夹排除在监视之外?有没有办法在不弹出的情况下实现这一目标?

最佳答案

来自 https://github.com/facebook/create-react-app/issues/2541 :

I don't think we'll do this as it seems like people generally don't use public folder for uploads. And it wouldn't work in production anyway.

I would recommend to use a separate server (which you need anyway) and separate folder for image uploads, and have the app load images from a different host/port (just like it would in production, e.g. from a CDN).

关于javascript - create-react-app 排除文件夹触发重新加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46876570/

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