feat(nuxt): support Nuxt 4 and pre-bundle pinia-orm in dev#2047
Merged
Conversation
Upgrades the module to @nuxt/kit 4 / module-builder 1 with an explicit nuxt >=3.14 compatibility range. The module now adds pinia-orm to vite's optimizeDeps.include (opt-out via piniaOrm.optimizeDeps: false) to avoid dev server restarts when the first repository is used. Both playgrounds run on Nuxt 4 with pinia 4 and @pinia/nuxt 1.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2047 +/- ##
=======================================
Coverage 99.24% 99.24%
=======================================
Files 83 83
Lines 3185 3185
Branches 562 562
=======================================
Hits 3161 3161
Misses 17 17
Partials 7 7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nuxt 4 support
@nuxt/kit^4.5,@nuxt/module-builder^1,nuxt4.5 as dev dependency, explicitcompatibility: { nuxt: '>=3.14.0' }— the module keeps working on current Nuxt 3 while being first-class on Nuxt 4>=0.10.0unchanged, so Nuxt-3/pinia-3 setups keep resolving)@unhead/vuededuped to a Nuxt-4-compatible version in the lockfileNew feature: automatic dependency optimization
The module now pushes
pinia-orm(+ its normalizr chunk) intovite.optimizeDeps.include. This kills the classic dev-server annoyance where vite discovers pinia-orm late and restarts with "new dependencies optimized — reloading". Opt-out:piniaOrm: { optimizeDeps: false }. Documented on the Nuxt setup page.Playgrounds
packages/nuxt/playgroundandplaygrounds/nuxt3both build green on Nuxt 4.5 (verified locally withnuxi build)playgrounds/nuxt3bumped to nuxt ^4.5, @pinia/nuxt ^1, pinia ^4, uuid ^11, nanoid ^5Other ideas considered (not included, possible follow-ups)
addImportsDirconvention for a~/modelsdirectory (auto-import model classes)useAxiosRepowhen@pinia-orm/axiosis installeduseRepopayload plugin for SSR state transfer tuningNote: merging this after #2046 (Node 22) produces a trivial package.json conflict (engines field) that gets resolved on merge.