Nuxt Build Cache is an experimental module for Nuxt 3 designed to significantly accelerate CI/CD build processes by caching generated `.nuxt/` artifacts. Currently at version 0.1.1, its release cadence is irregular as it's under active development. The module works by collecting build outputs into a tar file after a `nuxt build`. On subsequent builds, it generates a content-based hash from various sources including Nuxt configuration, files in known Nuxt directories (like `pages/`, `layouts/`), and key project root files (`package.json`, lock-files). If this hash remains unchanged, it bypasses the Vite/Webpack build step and restores the cached build, potentially reducing build times by up to 2x. This mechanism is particularly beneficial when only prerendered content or server routes have changed, differentiating it from traditional file-based caching by focusing on a comprehensive content hash. It aims to replicate similar build performance improvements seen in Nuxt 2.
npm install nuxt-build-cacheVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to add the `nuxt-build-cache` module using the Nuxt CLI and then configure it in your `nuxt.config.ts`.
Thoroughly test in non-production environments before deploying to critical systems. Monitor the GitHub repository for updates and stability reports.
Avoid dynamic values in `nuxt.config.ts` that change with every build. For runtime-specific configurations, prefer using environment variables, which will be correctly included in the hash if updated.
If unexpected build times or stale content occur, consider clearing the cache manually (e.g., `rm -rf node_modules/.cache/nuxt/build`) or temporarily disabling the module via `NUXT_DISABLE_BUILD_CACHE=true`.
Ensure `NUXT_DISABLE_BUILD_CACHE` is not set to `true` and `NUXT_IGNORE_BUILD_CACHE` is not set. Review your `nuxt.config.ts` for any dynamic values that might change on each build.
Manually clear the build cache by removing `node_modules/.cache/nuxt/build/` and try rebuilding. Report the issue to the module's maintainers if it persists, providing details on what changes were not detected.
No dependency data recorded yet.