{"id":15634634,"url":"https://github.com/pi0/nuxt-build-cache","last_synced_at":"2025-04-07T14:14:39.879Z","repository":{"id":221391452,"uuid":"754250096","full_name":"pi0/nuxt-build-cache","owner":"pi0","description":"▣ Speed up your Nuxt builds up to 2x [experimental]","archived":false,"fork":false,"pushed_at":"2024-02-08T10:08:41.000Z","size":209,"stargazers_count":135,"open_issues_count":5,"forks_count":0,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-05-02T01:03:36.275Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pi0.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["pi0"]}},"created_at":"2024-02-07T17:31:35.000Z","updated_at":"2024-04-25T07:54:35.000Z","dependencies_parsed_at":"2024-10-03T10:54:57.732Z","dependency_job_id":"008e5e54-2874-4e81-8fd0-383a91a37ed7","html_url":"https://github.com/pi0/nuxt-build-cache","commit_stats":null,"previous_names":["pi0/nuxt-build-cache"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pi0%2Fnuxt-build-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pi0%2Fnuxt-build-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pi0%2Fnuxt-build-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pi0%2Fnuxt-build-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pi0","download_url":"https://codeload.github.com/pi0/nuxt-build-cache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247666015,"owners_count":20975788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T10:54:55.687Z","updated_at":"2025-04-07T14:14:39.850Z","avatar_url":"https://github.com/pi0.png","language":"TypeScript","readme":"# ▣ Nuxt Build Cache\n\n\u003e [!IMPORTANT]\n\u003e This is a highly experimental project. Use at your own risk in production!\n\n## ✨ Quick Start\n\n```sh\nnpx nuxi module add nuxt-build-cache\n```\n\n## 💡 What does it do?\n\nBy enabling this module, after a `nuxt build`, Nuxt collects build artifacts from `.nuxt/` dir into a tar file. On subsequent builds, if none of the relevant dependencies or your codes change, Nuxt will avoid the Vite/Webpack build step and simply restore the previous build results.\n\nThis is particularly useful to speed up the CI/CD process when only prerendered content (from a CMS for example) or server routes are changed and can significantly speed up build speeds ([up to 2x!](https://twitter.com/_pi0_/status/1755333805349507100)). This is a similar feature [we introduced in Nuxt 2](https://nuxt.com/blog/nuxt-static-improvements).\n\n### How does the module determine if a new build is required?\n\nWe generate a hash of the current state during the build from various sources using [unjs/ohash](https://github.com/unjs/ohash) and then use this hash to store the build artifacts. (By default in `node_modules/.cache/nuxt/build/{hash}/`). This way each cache is unique to the project state it was built from.\n\nThe hash is generated from your code and all Nuxt layers (that are not in `node_modules`):\n\n- Loaded config\n- Files in known Nuxt directories (`pages/`, `layouts/`, `app.vue`, ...)\n- Known project root files (`package.json`, `.nuxtrc`, `.npmrc`, package manager lock-file, ...)\n\n\u003e [!NOTE]\n\u003e File hashes are based on their size and content digest (murmurHash v3)\n\n\u003e [!IMPORTANT]\n\u003e Config layer hashes will be generated from the loaded value.\n\u003e If you have a config like `{ date: new Date() }`, the cache will not work! But if you update a runtime value in `nuxt.config` (like an environment variable), it will be used as a source for your build hashes 👍\n\n## ⚙️ Environment variables\n\n- `NUXT_DISABLE_BUILD_CACHE`: Disable the module entirely\n- `NUXT_IGNORE_BUILD_CACHE`: Skip restoring cache even if it exists\n","funding_links":["https://github.com/sponsors/pi0"],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpi0%2Fnuxt-build-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpi0%2Fnuxt-build-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpi0%2Fnuxt-build-cache/lists"}