在 esp32 上部署 React,文件名限制为 32 个字符
我想在 esp32 微控制器上的 Web 服务器上部署一个 React 应用程序,以控制同一微控制器上的 api。
Web 服务器正在工作,可以发送文件和接收请求。唯一真正的问题是React应用程序的文件名太长(即./build/static/js/988.78dc5abd.chunk.js),而esp32上的文件系统限制文件名不超过31个字符。
我尝试通过编辑 webpack.config.js 来减少文件名,但这似乎不再起作用。我还尝试将其捆绑在一个文件中,但我也无法弄清楚。增加文件名限制似乎也是不可能的。
有谁知道如何在文件名限制为 32 个字符的文件系统上部署 React 应用程序?
I would like to deploy a react application on a web server on an esp32 micro controller, to control an api on that same micro controller.
The web server is working and can send files and receive requests. The only real problem is that file names of react apps are too long (i.e. ./build/static/js/988.78dc5abd.chunk.js), while the file system on an esp32 is limited to file names no longer than 31 characters.
I tried reducing the file names by editing webpack.config.js, but that doesn't appear to work anymore. I also tried bundling it in a single file which I also could not figure out. Increasing the file name limit also seems impossible.
Does anyone have an idea of how I could deploy a react app on a file system that is limited to file names with 32 characters?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑:实际最好的方法是创建一个自定义的 React Webpack 并使用结果制作一个 tarball
我为这个问题创建了一个非常糟糕的解决方案,所以如果你遇到这篇文章,请确保你已经用尽了所有在尝试复制此内容之前,还有其他选项:
基本上,我创建了一个脚本,以递归方式从 React 应用程序构建目录(rapp/build)中获取所有文件,并将它们全部复制到带有数字和正确扩展名的数据文件夹中(因此浏览器选择文件类型):
然后我创建了一个 Web 服务器,它将自动将所有请求重定向到复制的编号文件:
EDIT: The actual best way is to create a custom react webpack and make a tarball with the result
I created a pretty terrible solution to this problem, so if you came across this post, ensure you have exhausted all other options before you attempt to copy this:
Basically I have created a script takes all the files recursively from the react app build directory (rapp/build) and copies them all to the data folder with a number and the correct extension (so the browser picks up the file type):
then i have created a web server that will automatically redirect all the request to the copied numbered files: