我按照 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 上查看我修改后的管理員嗎?
謝謝 !
uj5u.com熱心網友回復:
發現解決方案女巫是愚蠢的。這是因為打字錯誤:我的檔案名是Index.js而不是index.js。
現在我的 index.js 檔案正確替換了位于 node_modules 中的 index.js,所以現在一切正常。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/318899.html
標籤:javascript 节点.js 英雄 带皮
