.umi 文件夹下的 umi.js 不可编辑,如何修改 createHistory basename ?是否可以通过配置 .umirc.js 解决?
import createHistory from 'umi/_createHistory'; // create history window.g_history = createHistory({ basename: window.routerBase, });
dva2问题#1497
https://umijs.org/docs/zh-Hans/deploy.html#html
@sorrycc 我配置了 base 部署到非根目录 /sub-path/ ,在页面内部能正常路由。但是如果直接通过地址栏访问特定页面的完整路径,如 /sub-path/login ,就不行了。还有什么我没注意到吗?
/sub-path/
/sub-path/login
猜测可能是和服务器配置有关,由于我是部署在 Github Pages 的,所以暂时也不知道怎么搞了
部署在Github Pages https://www.npmjs.com/package/umi-plugin-gh-pages
Most helpful comment
https://umijs.org/docs/zh-Hans/deploy.html#html