Skip to content

feat(kit): load /module or /nuxt module subpath if it exists#24707

Merged
danielroe merged 3 commits intomainfrom
feat/module-subpath
Dec 12, 2023
Merged

feat(kit): load /module or /nuxt module subpath if it exists#24707
danielroe merged 3 commits intomainfrom
feat/module-subpath

Conversation

@danielroe
Copy link
Copy Markdown
Member

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ 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

This adds support for detecting a /module subpath and loading it where it exists.

This would mean a project that is primarily a library can ship a Nuxt module as /module and support adding just the root library name to modules: [].

Example

  export default defineNuxtConfig({
    modules: [
-    'some-library/module'
+    'some-library'
    ]
  })

(We can, for example, use this straight away for @nuxt/test-utils/module.)

📝 Checklist

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

@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@danielroe danielroe added this to the 3.9 milestone Dec 12, 2023
@atinux
Copy link
Copy Markdown
Member

atinux commented Dec 12, 2023

I love the idea 🚀

Co-authored-by: Pooya Parsa <pyapar@gmail.com>
Copy link
Copy Markdown
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

🚀

@danielroe danielroe changed the title feat(kit): support automatic loading of /module subpath if it exists feat(kit): support automatic loading of /module or /nuxt subpath if it exists Dec 12, 2023
@danielroe danielroe changed the title feat(kit): support automatic loading of /module or /nuxt subpath if it exists feat(kit): load of /module or /nuxt module subpath if it exists Dec 12, 2023
@danielroe danielroe changed the title feat(kit): load of /module or /nuxt module subpath if it exists feat(kit): load /module or /nuxt module subpath if it exists Dec 12, 2023
@danielroe danielroe merged commit 7827f18 into main Dec 12, 2023
@danielroe danielroe deleted the feat/module-subpath branch December 12, 2023 17:55
@github-actions github-actions bot mentioned this pull request Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants