UMI 4.0 踩坑记录 #8421
huarse
started this conversation in
Show and tell
UMI 4.0 踩坑记录
#8421
Replies: 2 comments 6 replies
-
umi4的时候,需要在html手动配置window.publicPath,然后umirc中配置runtimePublicPath: {}即可 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
花了几天时间尝试将原来的 3.0 框架升级到 4.0,确实遇到了不少坑,以下是一些参照官方文档也无法避免的问题,仅供参考:
styles
和scripts
注入的文件均会在 umi.js 和 umi.css 后面,导致出现依赖顺序问题,解决办法:写一个插件,通过modifyHTML
等 API 手动注入;target
不能有 edge 浏览器,否则会报错;redirect
不能带上路径参数(已经有人提 PR,等待解决,可临时在入口加手动跳转);history
设置为browser
,并开启runtimePublicPath
时,在 development 环境下,window.publicPath
必须设置成/
,如果是./
会导致依赖文件都从当前的相对路径加载;onRouteChange
,然后手动修改document.title
Beta Was this translation helpful? Give feedback.
All reactions