我有一个应用程序,它的工作方式如下:
/client/app/public/build。在运行yarn run build并执行postbuild脚本后,它将立即失败,并出现以下错误:
yarn run v1.9.4
$ react-snap
events.js:183
throw er; // Unhandled 'error' event
^
Error: ENOENT: no such file or directory, open '/Users/aington/git/static-help/build/index.html'
error Command failed with exit code 1.这是有意义的,因为在那个位置没有文件。
我知道react-snap以自己是一个零配置库而自豪,但我真的很想对它进行配置,以便它能够指向正确的目录来服务文件。此外,Express服务器还提供了身份验证库,因此也需要运行。
期望react-snap能够做到这一点,并且仍然爬行和预渲染站点是现实的吗?还是我应该探索其他选择?
发布于 2019-09-19 01:02:10
检查index.js中的默认选项
并在package.json中使用它,如下所示
"reactSnap" : {
"source" : "./dist"
}https://stackoverflow.com/questions/54850716
复制相似问题