refactor: Consolidate base configuration in .fatherrc.ts#9506
refactor: Consolidate base configuration in .fatherrc.ts#9506zzjiaxiang wants to merge 2 commits intoant-design:masterfrom
Conversation
- Introduced a baseConfig object to streamline esm and cjs configurations. - Removed redundant input, platform, transformer, and targets definitions in both configurations. - Enhanced maintainability and clarity of the configuration file.
Summary of ChangesHello @zzjiaxiang, 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! 此拉取请求通过将 Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough在 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 分钟 诗
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
| cjs: { | ||
| input: 'src', // 默认编译目录 | ||
| output: 'lib', | ||
| platform: 'browser', // 默认构建为 Node.js 环境的产物 | ||
| transformer: 'babel', // 默认使用 esbuild 以获得更快的构建速度 | ||
| targets, | ||
| ...baseConfig, | ||
| }, |
There was a problem hiding this comment.
CJS 构建产物(lib 目录)通常是为 Node.js 环境准备的,package.json 中的 main 字段也指向了它。之前的配置中,CJS 的 platform 被设为 'browser',但注释却表明是用于 Node.js 环境。这次重构保留了 platform 为 'browser' 的设定。
为了确保构建产物针对目标环境进行正确优化,建议为 CJS 构建显式地设置 platform: 'node'。由于 baseConfig 中已设置 platform: 'browser',你需要在 cjs 配置中覆盖它。
建议修改如下:
cjs: {
output: 'lib',
...baseConfig,
platform: 'node',
},
提取出统一的配置,移除
input:src默认值不用写. 同时开启并发编译Summary by CodeRabbit