Skip to content

feat: scan nested subfolders for custom collections#407

Merged
antfu merged 3 commits intonuxt:mainfrom
svifty7:feat/scan-nested-subfolders
Oct 22, 2025
Merged

feat: scan nested subfolders for custom collections#407
antfu merged 3 commits intonuxt:mainfrom
svifty7:feat/scan-nested-subfolders

Conversation

@svifty7
Copy link
Copy Markdown
Contributor

@svifty7 svifty7 commented Jun 25, 2025

🔗 Linked issue

#374 - Recursive search in customCollections directories

❓ 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

Added an enhancement to the @nuxt/icon library that enables scanning of nested subfolders for custom SVG icon collections. Icons located in paths like path/to/icon.svg are now automatically included in the bundle with the name path-to-icon. This expands the ability to work with deeply nested folder structures, simplifying the organization and use of custom icons.

Why is this change necessary?
Previously, the library only supported icons in the root folder of a collection, limiting file organization. This enhancement makes the structure more flexible, allowing developers to use nested folders without needing to create flat icon names like arrow-right-line.svg or arrow-right-outline.svg.

What problem does it solve?
Removes the limitation of scanning only the root folder, improving UX for developers working with custom icon collections in complex project structures.

Copy link
Copy Markdown
Member

@antfu antfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have an option to toggle this behavour, as nested might not always be desired in every project.

@svifty7
Copy link
Copy Markdown
Contributor Author

svifty7 commented Jun 27, 2025

Agreed, I’ve implemented a parameter to support this behavior

@svifty7 svifty7 force-pushed the feat/scan-nested-subfolders branch from 76d4358 to 11fffa9 Compare October 9, 2025 08:43
@antfu antfu merged commit f9f5ba1 into nuxt:main Oct 22, 2025
1 check passed
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.

2 participants