fix!: allow overriding default format/screens/densities#2138
fix!: allow overriding default format/screens/densities#2138DamianGlowala wants to merge 4 commits intomainfrom
format/screens/densities#2138Conversation
Deploying nuxt-image with
|
| Latest commit: |
dac3aef
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d28e7d62.nuxt-image.pages.dev |
| Branch Preview URL: | https://fix-module-options-overridin.nuxt-image.pages.dev |
commit: |
📝 WalkthroughWalkthroughDefaults for array/object image options were moved from module-definition time to setup-time normalization. The explicit type assertion for Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@playground/nuxt.config.ts`:
- Line 19: The formats array in playground/nuxt.config.ts currently contains
both 'jpg' and 'jpeg' which are aliases and can cause inconsistent provider
behavior; update the formats array (the format entry used by the image provider
config) to use a single canonical value (prefer 'jpeg') or explicitly
document/justify keeping both if testing aliases, and ensure the chosen value
works with your targeted providers (notably hygraph which only accepts 'jpg').
|
Finally a fix for this 👍 This has been a blocker to upgrade to v2, for me. But the export default defineNuxtConfig({
image: {
screens: {
'sm': undefined,
'3xl': 2000,
}
}
})But that's just my opinion ^^ |
format/screens/densities module optionsformat/screens/densities
format/screens/densitiesformat/screens/densities
|
this seems like a breaking change - if users were previously only adding a value this will be unexpected. we likely need to defer this to the next major of nuxt/image |
🔗 Linked issue
resolves #1874
resolves #2020
📚 Description
This moves non-empty arrays and objects from
defaultsofdefineNuxtModuleto setup block, so that they are not affected by default merging behaviour.