-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix: windows 下开启CompileMode报错 (#15252) #17583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Walkthrough本次更改在 Changes
Assessment against linked issues
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/taro-webpack5-runner/src/plugins/MiniCompileModePlugin.ts (1)
301-302
: 对 XS 导入路径同样进行标准化
在template.buildXsImportTemplate
前使用normalizePath(path.relative(...))
,保证生成的 xs 导入路径跨平台一致。建议将path.dirname(key)
与path.relative
的组合提取为内部小函数以减少冗余。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/taro-webpack5-runner/src/plugins/MiniCompileModePlugin.ts
(2 hunks)
🔇 Additional comments (2)
packages/taro-webpack5-runner/src/plugins/MiniCompileModePlugin.ts (2)
299-299
: 对基础模板导入路径应用标准化
在<import src="..."/>
中对path.relative
结果调用normalizePath
,确保 Windows 下的反斜杠被转换为正斜杠,从而解决文件路径识别失败的问题。
30-30
:✅ Verification successful
导入
normalizePath
已正确从@tarojs/helper
导入normalizePath
,建议确认该依赖是否已在package.json
中声明以避免构建时缺失。
🏁 Script executed:
#!/bin/bash # 验证 @tarojs/helper 是否已在 package.json 中列出 grep -R "\"@tarojs/helper\"" -n package.jsonLength of output: 44
🏁 Script executed:
#!/bin/bash # 在整个仓库的所有 package.json 文件中查找是否声明了 @tarojs/helper grep -R '"@tarojs/helper"' -n .Length of output: 13506
依赖已在 package.json 中声明,无需修改
已在packages/taro-webpack5-runner/package.json
(第 36 行)以workspace:*
方式声明@tarojs/helper
,验证通过。
这个 PR 做了什么? (简要描述所做更改)
windows 系统下开启 CompileMode 编译代码后,
*-templates.wxml
文件中引用文件的路径错误,开发者工具无法识别到文件,在此规范化文件路径这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台:
Summary by CodeRabbit