javascript - Strapi 自定义管理员不在远程服务器上工作
问题描述
我按照 Strapi 文档https://strapi.io/documentation/developer-docs/latest/guides/custom-admin.html#introduction修改了页面 ./admin/src/containers/HomePage/Index.js。
在本地一切正常,我也在本地进行了构建,但是在部署到 Heroku 后我无法看到这个修改后的页面。
我尝试停用 node_modules 缓存(如下所示:https ://devcenter.heroku.com/articles/nodejs-support#cache-behavior ),我还通过自定义.gitignore配置将我修改的文件推送到存储库中避免缓存问题:
*.cache/*
!.cache/admin/
*.cache/admin/*
!.cache/admin/src
*.cache/admin/src/*
!.cache/admin/src/containers
*.cache/admin/src/containers/*
!.cache/admin/src/containers/HomePage
*.cache/admin/src/containers/HomePage/*
!.cache/admin/src/containers/HomePage/Index.js
这个配置只推送文件 Index.js 而不是其余的。但它也不起作用。
我还安装了这个缓存管理器插件(https://help.heroku.com/18PI5RSY/how-do-i-clear-the-build-cache)但是清除命令和重新部署并不能解决问题......
你知道如何在 Heroku 上查看我修改后的管理员吗?
谢谢 !
解决方案
发现解决方案女巫是愚蠢的。这是因为一个错字:我的文件名是Index.js而不是index.js。
现在我的 index.js 文件正确替换了 node_modules 中的 index.js,所以现在一切正常。
推荐阅读
- android - 应用程序从 Google Play 接收更新时的生命周期
- angular - 另一个 ID 为 ####### 的进程当前正在运行 ngcc
- sql - 如何从子查询中获取多列?[错误] 执行 (167: 13): ORA-00913: 值太多
- python - Python OpenGL - 线程中没有有效的上下文
- stream - Elixir:如何跨多个管道维护 Stream 状态?
- java - 在 REST API 中使用不同的路径访问相同的资源
- date - Google表格中的动态日期功能-如何实现?
- barbajs - Barba.js 和 locomotive-scroll 不兼容?
- c# - 如何在 csproj 中检查条件编译符号
- sql - 在 Postgresql 中使用列值上的 where 子句更新表