-
Notifications
You must be signed in to change notification settings - Fork 85
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
fix(bundler-mako): experimental config should be merged deeply #1617
Conversation
Walkthrough此次更改涉及对 Changes
Possibly related PRs
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? 🪧 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
🧹 Outside diff range and nitpick comments (1)
packages/bundler-mako/index.js (1)
639-648
: 配置对象结构优化,但可以进一步改进这些更改改进了配置对象的组织结构,使其更加清晰和一致。将
mako
对象的展开移到其他属性之后是一个好的做法,因为它允许覆盖默认值。同样,合并mako.experimental
与默认的实验性设置也很合理。然而,我建议进一步优化代码结构,以提高可读性:
考虑将
experimental
对象的定义提取到getMakoConfig
函数的顶部,这样可以使主要的返回语句更简洁:function getMakoConfig(opts) { // ... 现有代码 ... + const experimentalConfig = { + webpackSyntaxValidate: [], + requireContext: true, + detectCircularDependence: { + ignores: ['node_modules', '\\.umi'], + graphviz: false, + }, + ...mako.experimental, + }; const makoConfig = { // ... 其他配置 ... sass: sassLoader, ...mako, - experimental: { - webpackSyntaxValidate: [], - requireContext: true, - detectCircularDependence: { - ignores: ['node_modules', '\\.umi'], - graphviz: false, - }, - ...mako.experimental, - }, + experimental: experimentalConfig, }; return makoConfig; }这种方法可以使主要的配置对象更加简洁,同时保持实验性配置的灵活性。
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1617 +/- ##
=======================================
Coverage 61.95% 61.95%
=======================================
Files 128 128
Lines 15415 15415
=======================================
Hits 9550 9550
Misses 5865 5865 ☔ View full report in Codecov by Sentry. |
ref #1578
Summary by CodeRabbit