首页 > 解决方案 > 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 上查看我修改后的管理员吗?

谢谢 !

标签: javascriptnode.jsherokustrapi

解决方案


发现解决方案女巫是愚蠢的。这是因为一个错字:我的文件名是Index.js而不是index.js

现在我的 index.js 文件正确替换了 node_modules 中的 index.js,所以现在一切正常。


推荐阅读