Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.
Additional changes to review1 matched termMatched wording:deprecatedThese matches may be harmless in context. Expand to see the excerpts.
The changelog mentions deprecation; it may still be compatible.
This replaces the deprecated installModule function and provides a more robust way to handle module dependencies with version constraints and configuration merging.
👀 Highlights
🔥 Build and Performance Improvements
🍫 Enhanced Chunk Stability
Build stability has been significantly improved with import maps (#33075). This prevents cascading hash changes that could invalidate large portions of your build when small changes are made:
By default, JS chunks emitted in a Vite build are hashed, which means they can be cached immutably. However, this can cause a significant issue: a change to a single component can cause every hash to be invalidated, massively increasing the chance of 404s.
In short:
a component is changed slightly - the hash of its JS chunk changes
the page which uses the component has to be updated to reference the new file name
the entry now has its hash changed because it dynamically imports the page
every other file which imports the entry has its hash changed because the entry file name is changed
Obviously this wasn't optimal. With this new feature, the hash of (otherwise) unchanged files which import the entry won't be affected.
This feature is automatically enabled and helps maintain better cache efficiency in production. It does require native import map support, but Nuxt will automatically disable it if you have configured to include a browser that doesn't support import maps.
Nuxt now includes experimental support for rolldown-vite (#31812), bringing Rust-powered bundling for potentially faster builds.
To try Rolldown in your Nuxt project, you need to override Vite with the rolldown-powered version since Vite is a dependency of Nuxt. Add the following to your package.json:
After adding the override, reinstall your dependencies. Nuxt will automatically detect when Rolldown is available and adjust its build configuration accordingly.
This is experimental and may have some limitations, but offers a glimpse into the future of high-performance bundling in Nuxt.
🧪 Improved Lazy Hydration
Lazy hydration macros now work without auto-imports (#33037), making them more reliable when component auto-discovery is disabled:
<script setup>
// Works even with components: false
const LazyComponent = defineLazyHydrationComponent(
'visible',
() => import('./MyComponent.vue')
)
</script>
This ensures that components that are not "discovered" through Nuxt (e.g., because components is set to false in the config) can still be used in lazy hydration macros.
📄 Enhanced Page Rules
If you have enabled experimental extraction of route rules, these are now exposed on a dedicated rules property on NuxtPage objects (#32897), making them more accessible to modules and improving the overall architecture:
The defineRouteRules function continues to work exactly as before, but now provides better integration possibilities for modules.
🚀 Module Development Enhancements
Module Dependencies and Integration
Modules can now specify dependencies and modify options for other modules (#33063). This enables better module integration and ensures proper setup order:
export default defineNuxtModule({
meta: {
name: 'my-module',
},
moduleDependencies: {
'some-module': {
// You can specify a version constraint for the module
version: '>=2',
// By default moduleDependencies will be added to the list of modules
// to be installed by Nuxt unless `optional` is set.
optional: true,
// Any configuration that should override `nuxt.options`.
overrides: {},
// Any configuration that should be set. It will override module defaults but
// will not override any configuration set in `nuxt.options`.
defaults: {}
}
},
setup (options, nuxt) {
// Your module setup logic
}
})
This replaces the deprecated installModule function and provides a more robust way to handle module dependencies with version constraints and configuration merging.
🪝 Module Lifecycle Hooks
Module authors now have access to two new lifecycle hooks: onInstall and onUpgrade (#32397). These hooks allow modules to perform additional setup steps when first installed or when upgraded to a new version:
export default defineNuxtModule({
meta: {
name: 'my-module',
version: '1.0.0',
},
onInstall(nuxt) {
// This will be run when the module is first installed
console.log('Setting up my-module for the first time!')
},
onUpgrade(inlineOptions, nuxt, previousVersion) {
// This will be run when the module is upgraded
console.log(`Upgrading my-module from v${previousVersion}`)
}
})
The hooks are only triggered when both name and version are provided in the module metadata. Nuxt uses the .nuxtrc file internally to track module versions and trigger the appropriate hooks. (If you haven't come across it before, the .nuxtrc file should be committed to version control.)
Tip
This means module authors can begin implementing their own 'setup wizards' to provide a better experience when some setup is required after installing a module.
🙈 Enhanced File Resolution
The new ignore option for resolveFiles (#32858) allows module authors to exclude specific files based on glob patterns:
// Resolve all .vue files except test files
const files = await resolveFiles(srcDir, '**/*.vue', {
ignore: ['**/*.test.vue', '**/__tests__/**']
})
📂 Layer Directories Utility
A new getLayerDirectories utility (#33098) provides a clean interface for accessing layer directories without directly accessing private APIs:
import { getLayerDirectories } from '@nuxt/kit'
const layerDirs = await getLayerDirectories(nuxt)
// Access key directories:
// layerDirs.app - /app/ by default
// layerDirs.appPages - /app/pages by default
// layerDirs.server - /server by default
// layerDirs.public - /public by default
✨ Developer Experience Improvements
🎱 Simplified Kit Utilities
Several kit utilities have been improved for better developer experience:
addServerImports now supports single imports (#32289):