Skip to content

Conversation

@fireairforce
Copy link

调整一些运行时代码,用于适配 output.publicPath 配置,通过 umi 应用测试正常:

截屏2025-10-11 21 31 46

@gemini-code-assist
Copy link

Summary of Changes

Hello @fireairforce, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求旨在修复 Turbopack 运行时中 CHUNK_BASE_PATHoutput.publicPath 配置的适配问题。通过移除冗余的路径规范化逻辑并统一 CHUNK_BASE_PATH 的使用方式,确保了运行时资源路径的正确解析和应用。这些更改已通过 umi 应用测试验证。

Highlights

  • 路径规范化简化: 移除了 normalizeChunkPath 函数及其对 CHUNK_BASE_PATH 的规范化处理,简化了运行时路径处理逻辑。
  • 统一 CHUNK_BASE_PATH 使用: 调整了 getChunkRelativeUrlgetPathFromScript 函数,使其直接使用原始的 CHUNK_BASE_PATH,不再进行额外的路径规范化,确保 output.publicPath 配置的正确适配。
  • 开发环境 DOM 后端更新: 更新了开发环境的 DOM 后端逻辑,移除了对 chunkUrl 的不必要处理,直接使用 chunkUrl 来查询和设置样式表链接,并简化了 sourceURL 的生成,提高了路径处理的一致性。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

这个 PR 旨在调整运行时代码以适配 output.publicPath,主要是通过移除 normalizeChunkPath 函数并直接使用 CHUNK_BASE_PATH。这个方向是正确的,但有几处代码变更引入了不健壮的 URL 路径拼接方式。当 CHUNK_BASE_PATH 是一个相对路径(例如 assets/)时,新的拼接方式可能会产生错误的 URL。我提出了一些修改建议,使用 URL 构造函数来更安全地处理路径拼接,以确保在各种 publicPath 配置下都能正常工作。

@fireairforce fireairforce merged commit 6e7674d into utoo Oct 11, 2025
13 of 26 checks passed
@xusd320 xusd320 deleted the adapt-chunk-base-path branch November 25, 2025 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants