{"id":15016540,"url":"https://github.com/zeroby0/netlify-plugin-11ty","last_synced_at":"2025-07-10T12:06:59.618Z","repository":{"id":65513436,"uuid":"387688071","full_name":"zeroby0/netlify-plugin-11ty","owner":"zeroby0","description":"A plugin to make building with Eleventy and Netlify a joy!","archived":false,"fork":false,"pushed_at":"2023-06-24T05:54:57.000Z","size":1920,"stargazers_count":30,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-07T17:13:56.694Z","etag":null,"topics":["11ty","cache","eleventy","hactoberfest","javascript","netlify","netlify-deployment","netlify-plugin","netlify-template","performance","plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeroby0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2021-07-20T05:57:52.000Z","updated_at":"2024-07-15T13:43:41.000Z","dependencies_parsed_at":"2024-06-21T14:11:19.415Z","dependency_job_id":"9187c353-41e2-43fc-b42a-cb7bdb596348","html_url":"https://github.com/zeroby0/netlify-plugin-11ty","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":"netlify/build-plugin-template","purl":"pkg:github/zeroby0/netlify-plugin-11ty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroby0%2Fnetlify-plugin-11ty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroby0%2Fnetlify-plugin-11ty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroby0%2Fnetlify-plugin-11ty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroby0%2Fnetlify-plugin-11ty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeroby0","download_url":"https://codeload.github.com/zeroby0/netlify-plugin-11ty/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroby0%2Fnetlify-plugin-11ty/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264577406,"owners_count":23631330,"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":["11ty","cache","eleventy","hactoberfest","javascript","netlify","netlify-deployment","netlify-plugin","netlify-template","performance","plugin"],"created_at":"2024-09-24T19:49:03.198Z","updated_at":"2025-07-10T12:06:59.579Z","avatar_url":"https://github.com/zeroby0.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Netlify 11ty Build Plugin\n\nA plugin to make building with Eleventy and Netlify a joy!\n\n### Speed up your builds ⚡\n\n- Caches images generated by\n  [@11ty/eleventy-img](https://github.com/11ty/eleventy-img) across builds\n- Caches assets fetched by\n  [@11ty/eleventy-fetch](https://github.com/11ty/eleventy-fetch) across builds\n- Caches any other folders of your choice (optional)\n\n## Install\n\nInstall plugin via your package manager of choice:\n\n```bash\nnpm i netlify-plugin-11ty\n```\n\nAnd add the plugin to your `netlify.toml` file:\n\n```toml\n[[plugins]]\n    package = \"netlify-plugin-11ty\"\n    [plugins.inputs]\n        # eleventy-img outputDir, path relative to publish directory\n        cache_img = 'img/'\n        cache_img_httpHeader = false\n\n        # eleventy-fetch cacheDir, path relative to publish directory\n        cache_assets = '../.cache/'\n        cache_other = []\n```\n\nMake sure the path for [`cache_img`](#1-cache_img) is correct. Aand you're done!\n🥳\n\nYou can read Netlify's documentation about Plugins here:\nhttps://docs.netlify.com/configure-builds/build-plugins/\n\n\n## Documentation\n\n### 1. `cache_img`\n\nType: `String` or `Array of Strings`  \nDefault: `'img'` (relative to the publish directory)\n\nPath to the folder(s) in which files generated by `@11ty/eleventy-img` are\nstored, relative to the publish directory. Can be a String or an array of\nStrings.\n\nIf set to `false`, files generated by `@11ty/eleventy-img` are not saved in\nNetlify cache.\n\n### 2. `cache_img_httpHeader`\n\nType: `Boolean`  \nDefault: `false`\n\nIf set to `true`, files generated by `@11ty/eleventy-img` will be served with\nhttp header `cache-control: public, max-age=31536000, immutable`.\n\nFiles generated by `eleventy_img` have a hash calculated using file content and\n[Sharp plugin options](https://www.11ty.dev/docs/plugins/image/#advanced-control-of-sharp-image-processor)\nin their name by default\n([starting from #116](https://github.com/11ty/eleventy-img/pull/116)), so you\ncan cache them indefinitely. Don't use this if you're using remote images.\n\n:warning: **Caution**:\n\n- If you are using remote images, this option should be `false` (default).\n- If you are using\n  [custom filenames](https://www.11ty.dev/docs/plugins/image/#custom-filenames-new-in-image-0.4.0)\n  that don't include a hash, this option should be `false` (default).\n\n### 3. `cache_assets`\n\nType: `String` or `Array of Strings`  \nDefault: `'../.cache'` (relative to the publish directory)\n\nPath to the folder(s) in which remote assets fetched by\n[@11ty/eleventy-fetch](https://github.com/11ty/eleventy-fetch) are cached,\nrelative to publish directory. Can be a String or an array of Strings.\n\nIf set to `false`, assets fetched by `@11ty/eleventy-fetch` are not saved in\nNetlify cache.\n\n### 4. `cache_other`\n\nType: `String` or `Array of Strings`  \nDefault: `[]` (relative to the publish directory)\n\nPaths to any other folder(s) you'd like to cache across Netlify builds. If these\nfolders exist before restoring Nelify cache, their content will be merged and\noverwritten with content from the cached folders.\n\n## FAQs\n\n### I `rimraf` my `_site` on every build\n\nIf your images are written to `_site/img` (default), use\n`rimraf '_site/!(img)'`.\n\nIf they are in a subdirectory, say `_site/assets/images`, use\n`rimraf '_site/!(assets)' '_site/assets/!(images)'`.\n\n### My builds are failing\n\nIf your build fails with\n\n```log\n11:37:10 AM: Uncaught exception, the process will now terminate…\n11:37:10 AM: Error: Unable to deserialize cloned data due to invalid or unsupported version.\n11:37:10 AM:     at parseChannelMessages (node:internal/child_process/serialization:97:20)\n11:37:10 AM:     at parseChannelMessages.next (\u003canonymous\u003e)\n11:37:10 AM:     at Pipe.channel.onread (node:internal/child_process:619:18)\n```\n\nor with\n\n```log\n12:27:30 PM: ────────────────────────────────────────────────────────────────\n12:27:30 PM:   Configuration error                                           \n12:27:30 PM: ────────────────────────────────────────────────────────────────\n12:27:30 PM: ​\n12:27:30 PM:   Error message\n12:27:30 PM:   The Node.js version is 19.1.0 but the plugin \"netlify-plugin-11ty\" requires \u003e=12.18.0 \u003c18.0.0\n```\n\nThe version of Node you're using is not supported by Netlify.\n\nTry setting Node version to 16.x with\n\n```bash\necho \"16\" \u003e .nvmrc\n```\n\nMore info about this error:\n\n- https://answers.netlify.com/t/netlify-build-cache-error/78115/4\n- https://answers.netlify.com/t/build-failing-after-upgrade-to-node-18/75774\n- https://github.com/zeroby0/netlify-plugin-11ty/issues/3\n\nSee this guide for more ways to set Node versions:\nhttps://docs.netlify.com/configure-builds/manage-dependencies/\n\n### Why are my images are not being cached?\n\nIf you have lot of images (several hundreds or more), \nyour build might be timing out before the cache is saved.\n\nIf you see `Failed during stage 'building site': Command did not finish within the time limit`\nin your build logs, try requesting an upgraded build time limit.\n\nSee this thread for more details: https://answers.netlify.com/t/images-not-cached/78448/2\n\nIf your builds are failing for some other reason, please create a \n[new Issue](https://github.com/zeroby0/netlify-plugin-11ty/issues).\n\n### Are there any Benchmarks?\n\nYes!\n\nThe speed-up, ofcourse, depends on how many images your website has, but here is\na benchmark I used when developing this plugin:\n\n| Run                    | No cache persistence | With cache persistence  |\n| ---------------------- | -------------------- | ----------------------- |\n| 1st run (empty cache)  | 11.74 seconds        | 11.52 seconds           |\n| 2nd run (filled cache) | 11.32 seconds        | 131.82 **milliseconds** |\n\n[Read more](https://github.com/11ty/eleventy-img/pull/116#issuecomment-882870369)\n\n## Recommended Netlify plugins\n\n- [Subfont](https://github.com/munter/netlify-plugin-subfont)\n- [Inline Critical CSS](https://github.com/Tom-Bonnike/netlify-plugin-inline-critical-css#readme)\n\n## Bug Reports, Feature Requests, and Ideas\n\nPlease\n[create an issue](https://github.com/zeroby0/netlify-plugin-11ty/issues/new/) :)\n\n## License\n\n**MIT**\n\nIf you need this repository with a different License, please\n[create an issue](https://github.com/zeroby0/netlify-plugin-11ty/issues/new/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroby0%2Fnetlify-plugin-11ty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeroby0%2Fnetlify-plugin-11ty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroby0%2Fnetlify-plugin-11ty/lists"}