Open flgame opened 1 week ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
[!WARNING]
Rate limit exceeded
@flgame has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 25 minutes and 41 seconds before requesting another review.
How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://coderabbit.ai/docs/faq) for further information.Commits
Files that changed from the base of the PR and between 00f90746e2309ea6f33a5c8bd8aff12f4cbee84a and 44fbe0b94fd988040237b73ee3618e3d65332109.
此次变更引入了针对静态文件导出的配置,包括HTML后缀、动态根路径和散列处理的设置。新增和修改的文件涵盖了页面组件、样式文件及核心控制逻辑,优化了静态导出功能的处理流程。
文件路径 | 变更摘要 |
---|---|
examples/export-static/.umirc.ts | 新增导出静态文件的配置,包含HTML后缀、动态根路径及散列的设定。 |
examples/export-static/package.json | 新增了项目构建、开发、初始化和启动的脚本配置,及Umi相关依赖。 |
examples/export-static/src/pages/404.tsx examples/export-static/src/pages/page1/index.tsx examples/export-static/src/pages/page1/page1_1/index.tsx |
添加了新的React功能组件用于显示页面内容,例如404页面和其他具体页面。 |
examples/export-static/src/pages/bar.css examples/export-static/src/pages/foo.less |
新增CSS和Less样式文件,定义了页面元素的样式规则。 |
examples/export-static/src/pages/index.tsx | 增加了主页的React功能组件,使用Helmet进行文档头管理,并包含多个设置了CSS模块的链接。 |
packages/preset-umi/src/features/exportStatic/exportStatic.ts | 进行了核心逻辑和控制流程的修改,引入了多个函数例如isHtmlRoute 和getHtmlPath ,并增加了对公共路径和资源的处理。 |
代码兔子跳跃欢,
配置静态焕新颜。
页面样式齐亮相,
功能优化稳如山。
新增函数巧妙设,
项目开发事半功倍。
静态导出更高效,
编码之路共美妙。
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
公司好几个项目升级umi4.x需要用到,希望能支持 https://github.com/umijs/umi/issues/12301
有一点需要说明的是
dynamicRoot 为新增配置,原publicPath: './'相对路径的方式也是有问题的,使用当前规则没问题。
对于
dynamicRoot:true, htmlSuffix: false
的场景,由于/page1 和 /page1/index.html 得到的相对路径不一样,但是又是同一个文件,对于headScripts等脚本路径是编译时确定的,没办法对前面两个路由同时生效。{ dynamicRoot:true, htmlSuffix: true }
使用 /page1、/page1.html 访问{ dynamicRoot:true, htmlSuffix: false }
使用 /page1/、/page1/index.html 访问已添加examples/export-static项目,且测试以下场景都正常:
① 约定式路由,不开启 dynamicRoot 、不开启 htmlSuffix 。 ② 约定式路由,开启 dynamicRoot 、不开启 htmlSuffix 。 ③ 约定式路由,不开启 dynamicRoot 、开启 htmlSuffix 。 ④ 约定式路由,开启 dynamicRoot 、开启 htmlSuffix 。 ⑤ 配置式路由,不开启 dynamicRoot 、不开启 htmlSuffix 。 ⑥ 配置式路由,开启 dynamicRoot 、不开启 htmlSuffix 。 ⑦ 配置式路由,不开启 dynamicRoot 、开启 htmlSuffix 。 ⑧ 配置式路由,开启 dynamicRoot 、开启 htmlSuffix 。
使用Whistle测试,对应
htmlSuffix: true
配置:htmlSuffix: false
配置:之前的PR已关闭,感谢 @fz6m 的修改意见,详见:https://github.com/umijs/umi/pull/12400
Summary by CodeRabbit
新功能
样式
.bar
类的绿色背景样式。.foo
、.foo2
和.foo3
类的颜色、字体大小和字体粗细样式。文档
package.json
文件,增加了构建、开发、设置和启动项目的脚本配置。