Skip to content

Conversation

danielroe
Copy link

@danielroe danielroe commented Sep 16, 2025

resolves #1255

this rewrites the nuxt plugin to use nuxt itself to resolve its own paths, supporting layers, modules, etc.

🚧 todo

at the moment test is failing.

we need to enable components + imports to register dependencies without being entries - ie. detect unused composables, but if a composable imports from something else, then that should count as that other thing being used

(this may be straightforward)

Copy link
Author

Choose a reason for hiding this comment

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

this is a valid nuxt entry, believe it or not, and if present nuxt would actually use this

Comment on lines +138 to +141
// TODO: we need to register these as source files which may not be all used
for (const path of availableSources) {
inputs.push(toProductionEntry(path, { allowIncludeExports: true }));
}
Copy link
Author

Choose a reason for hiding this comment

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

is there a way to register these paths so any imports into them are respected, but unused exports are detected?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, if I understand correctly, this is the breakdown:

  • default behavior: exports of entry files are not reported
  • skipExportsAnalysis: false - report unused exports (what you're asking for)
  • allowIncludeExports: true - report unused exports only with flag --include-entry-exports/includeEntryExports

@darthf1
Copy link

darthf1 commented Oct 17, 2025

Would be awesome to see this finished :)

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.

💡 Nuxt 4 Support

3 participants