Skip to content

Conversation

@ISOR3X
Copy link

@ISOR3X ISOR3X commented Nov 22, 2025

πŸ”— Linked issue

Resolves #4892

❓ 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

Allows adding external packages to be scanned for Nuxt UI components through the new allowedPackages option. This allows using Nuxt UI as a dependency for other projects.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@github-actions github-actions bot added the v4 #4488 label Nov 22, 2025
@ISOR3X
Copy link
Author

ISOR3X commented Nov 22, 2025

I wasn't sure about the name or location for the option. Besides the current option, I also considered extending ComponentsOptions since feature mostly relates to unplugin-vue-components. In the end I decided against it to keep that key purely for the options from that package.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 22, 2025

npm i https://pkg.pr.new/@nuxt/ui@5510

commit: 872e991

@benjamincanac
Copy link
Member

I'm wondering if it wouldn't be easier to just remove this exclude, do you have a reproduction to try if it doesn't decrease performances?

@ISOR3X
Copy link
Author

ISOR3X commented Nov 27, 2025

I'm wondering if it wouldn't be easier to just remove this exclude, do you have a reproduction to try if it doesn't decrease performances?

Wouldn't completely removing the exclude mean all node_module packages are scanned? I am not sure how unplugin-vue-components works, but I would expect that to take a lot longer than adding an option to scan a specific package.

@benjamincanac
Copy link
Member

@romhml What do you think of this? Maybe we should remove the hard-coded @compodium/examples and document it inside compodium to use this option with Vite?

@benjamincanac benjamincanac changed the title feat: add an option to allow external packages to be scanned for Nuxt UI components feat(unplugin): add option to allow external packages to scan for components Dec 8, 2025
@romhml
Copy link
Member

romhml commented Dec 15, 2025

@benjamincanac Removing the ignore in unplugin-auto-import can't be good for build performances. You can remove @compodium/example for the defaults, although it will make its setup a bit more complex.

@ISOR3X how do you plan to leverage this in your projects? Edit Nuxt UI's plugin config inside yours or ask users to configure it themselves?

@ISOR3X
Copy link
Author

ISOR3X commented Dec 15, 2025

@ISOR3X how do you plan to leverage this in your projects? Edit Nuxt UI's plugin config inside yours or ask users to configure it themselves?

The former. My main reason for this PR was mainly because we use Nuxt UI at the company I work at. Our UI library pretty much just wraps Nuxt UI and applies some different defaults and adds some extra components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using Nuxt UI in components from a npm package, in Vue

3 participants