Skip to content

feat: added image dir support for nuxt layer #1880

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wuiyang
Copy link

@wuiyang wuiyang commented Jun 25, 2025

πŸ”— Linked issue

resolves #1879

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

For Nuxt project that uses IPX provider, it would not search nuxt layer's custom dir.

This changes allows Nuxt project with local layers to look for image in layer's dir.

Note: with this changes, similar to root nuxt config with custom dir, would not work for runtime IPX, and only works for ipxStatic provider.

Note 2: As nuxt.options compiles all layer's config, if root is using default config (not providing any), it will have layer's dir value. The image dir config will retrieve from layer's config instead to prevent this issue.

-    const path = isRootLayer ? moduleOptions.dir : layer.config.dir?.public || 'public'
+    const path = layer?.config.image?.dir || layer.config.dir?.public || 'public'

@wuiyang wuiyang requested a review from danielroe as a code owner June 25, 2025 16:55
Copy link

vercel bot commented Jun 25, 2025

@wuiyang is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

pkg-pr-new bot commented Jun 25, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/image@1880

commit: 69e01a3

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.

Support custom nuxt layer image dir with IPX
1 participant