{"id":20509529,"url":"https://github.com/aminnairi/rollup-plugin-sitemap","last_synced_at":"2026-04-20T01:34:07.275Z","repository":{"id":58932449,"uuid":"534584433","full_name":"aminnairi/rollup-plugin-sitemap","owner":"aminnairi","description":"Sitemap generator","archived":false,"fork":false,"pushed_at":"2024-03-29T17:00:25.000Z","size":48,"stargazers_count":0,"open_issues_count":8,"forks_count":1,"subscribers_count":2,"default_branch":"development","last_synced_at":"2025-02-17T11:49:01.156Z","etag":null,"topics":["generator","plugin","rollup","sitemap","xml"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aminnairi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2022-09-09T09:43:55.000Z","updated_at":"2022-09-09T12:08:21.000Z","dependencies_parsed_at":"2024-03-29T11:23:15.850Z","dependency_job_id":"68ab790e-da44-4c44-b6df-35186279ce88","html_url":"https://github.com/aminnairi/rollup-plugin-sitemap","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminnairi%2Frollup-plugin-sitemap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminnairi%2Frollup-plugin-sitemap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminnairi%2Frollup-plugin-sitemap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminnairi%2Frollup-plugin-sitemap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aminnairi","download_url":"https://codeload.github.com/aminnairi/rollup-plugin-sitemap/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242112204,"owners_count":20073548,"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":["generator","plugin","rollup","sitemap","xml"],"created_at":"2024-11-15T20:25:16.968Z","updated_at":"2026-04-20T01:34:07.257Z","avatar_url":"https://github.com/aminnairi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @aminnairi/rollup-plugin-sitemap\n\n[![npm version](https://img.shields.io/npm/v/@aminnairi/rollup-plugin-sitemap.svg)](https://www.npmjs.com/package/@aminnairi/rollup-plugin-sitemap)\n[![types: included](https://img.shields.io/badge/types-included-blue)](https://www.typescriptlang.org/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![Codecov](https://img.shields.io/codecov/c/github/aminnairi/rollup-plugin-sitemap)](\u003chttps://codecov.io/gh/aminnairi/rollup-plugin-[![codecov](https://codecov.io/gh/aminnairi/rollup-plugin-sitemap/graph/badge.svg?token=DCCQ6G5HF9)](https://codecov.io/gh/aminnairi/rollup-plugin-sitemap)sitemap\u003e)\n\nSitemap generator\n\n## Installation\n\n```bash\nnpm install rollup @aminnairi/rollup-plugin-sitemap\ntouch rollup.config.js\n```\n\n## Configuration\n\n```javascript\nimport { defineConfig } from \"rollup\"\nimport { sitemap } from \"@aminnairi/rollup-plugin-sitemap\"\n\nexport default defineConfig({\n  input: \"index.js\",\n  plugins: [\n    sitemap({\n      baseUrl: \"https://domain.com\",\n      urls: [\n        { location: \"/\" },\n        { location: \"/about\" }\n        { location: \"/contact\" }\n      ]\n    })\n  ],\n  output: {\n    file: \"build/index.js\",\n    format: \"esm\"\n  }\n})\n```\n\n```xml\ncat build/sitemap.xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003curlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://domain.com/\u003c/loc\u003e\n  \u003c/url\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://domain.com/about\u003c/loc\u003e\n  \u003c/url\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://domain.com/contact\u003c/loc\u003e\n  \u003c/url\u003e\n\u003c/urlset\u003e\n```\n\n## Configuration with last modification\n\n```javascript\nimport { defineConfig } from \"rollup\"\nimport { sitemap } from \"@aminnairi/rollup-plugin-sitemap\"\n\nexport default defineConfig({\n  input: \"index.js\",\n  plugins: [\n    sitemap({\n      baseUrl: \"https://domain.com\",\n      urls: [\n        {\n          location: \"/\",\n          lastModified: new Date()\n        },\n        {\n          location: \"/about\",\n          lastModified: new Date()\n        }\n        {\n          location: \"/contact\",\n          lastModified: new Date()\n        }\n      ]\n    })\n  ],\n  output: {\n    file: \"build/index.js\",\n    format: \"esm\"\n  }\n})\n```\n\n```xml\ncat build/sitemap.xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003curlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://domain.com/\u003c/loc\u003e\n    \u003clastmod\u003e2022-09-09\u003c/lastmod\u003e\n  \u003c/url\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://domain.com/about\u003c/loc\u003e\n    \u003clastmod\u003e2022-09-09\u003c/lastmod\u003e\n  \u003c/url\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://domain.com/contact\u003c/loc\u003e\n    \u003clastmod\u003e2022-09-09\u003c/lastmod\u003e\n  \u003c/url\u003e\n\u003c/urlset\u003e\n```\n\n## Configuration with change frequency\n\n```javascript\nimport { defineConfig } from \"rollup\"\nimport { sitemap } from \"@aminnairi/rollup-plugin-sitemap\"\n\nexport default defineConfig({\n  input: \"index.js\",\n  plugins: [\n    sitemap({\n      baseUrl: \"https://domain.com\",\n      urls: [\n        {\n          location: \"/\",\n          changeFrequency: \"monthly\"\n        },\n        {\n          location: \"/about\",\n          changeFrequency: \"monthly\"\n        }\n        {\n          location: \"/contact\",\n          changeFrequency: \"monthly\"\n        }\n      ]\n    })\n  ],\n  output: {\n    file: \"build/index.js\",\n    format: \"esm\"\n  }\n})\n```\n\n```xml\ncat build/sitemap.xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003curlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://domain.com/\u003c/loc\u003e\n    \u003cchangefreq\u003emonthly\u003c/changefreq\u003e\n  \u003c/url\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://domain.com/about\u003c/loc\u003e\n    \u003cchangefreq\u003emonthly\u003c/changefreq\u003e\n  \u003c/url\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://domain.com/contact\u003c/loc\u003e\n    \u003cchangefreq\u003emonthly\u003c/changefreq\u003e\n  \u003c/url\u003e\n\u003c/urlset\u003e\n```\n\n## Configuration with priority\n\n```javascript\nimport { defineConfig } from \"rollup\"\nimport { sitemap } from \"@aminnairi/rollup-plugin-sitemap\"\n\nexport default defineConfig({\n  input: \"index.js\",\n  plugins: [\n    sitemap({\n      baseUrl: \"https://domain.com\",\n      urls: [\n        {\n          location: \"/\",\n          priority: 1\n        },\n        {\n          location: \"/about\",\n          priority: 1\n        }\n        {\n          location: \"/contact\",\n          priority: 1\n        }\n      ]\n    })\n  ],\n  output: {\n    file: \"build/index.js\",\n    format: \"esm\"\n  }\n})\n```\n\n```xml\ncat build/sitemap.xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003curlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://domain.com/\u003c/loc\u003e\n    \u003cpriority\u003e1\u003c/priority\u003e\n  \u003c/url\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://domain.com/about\u003c/loc\u003e\n    \u003cpriority\u003e1\u003c/priority\u003e\n  \u003c/url\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://domain.com/contact\u003c/loc\u003e\n    \u003cpriority\u003e1\u003c/priority\u003e\n  \u003c/url\u003e\n\u003c/urlset\u003e\n```\n\n## Configuration with custom path\n\nBy default, the sitemap is generated at `sitemap.xml`. You can customize this by using the `path` option:\n\n```javascript\nimport { defineConfig } from \"rollup\";\nimport { sitemap } from \"@aminnairi/rollup-plugin-sitemap\";\n\nexport default defineConfig({\n  input: \"index.js\",\n  plugins: [\n    sitemap({\n      baseUrl: \"https://domain.com\",\n      path: \"subcategory.sitemap.xml\",\n      urls: [{ location: \"/\" }],\n    }),\n  ],\n  output: {\n    file: \"build/index.js\",\n    format: \"esm\",\n  },\n});\n```\n\n```xml\ncat build/subcategory.sitemap.xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003curlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://domain.com/\u003c/loc\u003e\n  \u003c/url\u003e\n\u003c/urlset\u003e\n```\n\n## Configuration with robots.txt\n\nYou can also generate a `robots.txt` file alongside your sitemap using the `robots` option:\n\n```javascript\nimport { defineConfig } from \"rollup\";\nimport { sitemap } from \"@aminnairi/rollup-plugin-sitemap\";\n\nexport default defineConfig({\n  input: \"index.js\",\n  plugins: [\n    sitemap({\n      baseUrl: \"https://domain.com\",\n      urls: [{ location: \"/\" }],\n      robots: {\n        sitemap: true,\n      },\n    }),\n  ],\n  output: {\n    file: \"build/index.js\",\n    format: \"esm\",\n  },\n});\n```\n\n```txt\ncat build/robots.txt\nSitemap: https://domain.com/sitemap.xml\n```\n\n### Configuration with robots rules\n\nYou can add custom rules to the `robots.txt` file:\n\n```javascript\nimport { defineConfig } from \"rollup\";\nimport { sitemap } from \"@aminnairi/rollup-plugin-sitemap\";\n\nexport default defineConfig({\n  input: \"index.js\",\n  plugins: [\n    sitemap({\n      baseUrl: \"https://domain.com\",\n      urls: [{ location: \"/\" }],\n      robots: {\n        sitemap: true,\n        rules: [\n          {\n            description: \"Block GPT Bot from indexing\",\n            userAgent: \"GPTBot\",\n            disallow: \"/\",\n          },\n          {\n            description: \"Allow Google Bot to index everything\",\n            userAgent: \"Googlebot\",\n            allow: \"/\",\n          },\n        ],\n      },\n    }),\n  ],\n  output: {\n    file: \"build/index.js\",\n    format: \"esm\",\n  },\n});\n```\n\n```txt\ncat build/robots.txt\nSitemap: https://domain.com/sitemap.xml\n\n# Block GPT Bot from indexing\nUser-Agent: GPTBot\nDisallow: /\n\n# Allow Google Bot to index everything\nUser-Agent: Googlebot\nAllow: /\n```\n\n## Types\n\nThis package exports TypeScript types for advanced configuration:\n\n```typescript\nimport { defineConfig } from \"rollup\";\nimport {\n  sitemap,\n  type ChangeFrequency,\n  type Priority,\n  type Url,\n  type Robots,\n  type RobotsRule,\n} from \"@aminnairi/rollup-plugin-sitemap\";\n\nconst changeFrequency: ChangeFrequency = \"monthly\";\nconst priority: Priority = 0.8;\n\nconst url: Url = {\n  location: \"/\",\n  lastModified: new Date(),\n  changeFrequency,\n  priority,\n};\n\nconst robotsRule: RobotsRule = {\n  description: \"Block GPT Bot\",\n  userAgent: \"GPTBot\",\n  disallow: \"/\",\n};\n\nconst robots: Robots = {\n  sitemap: true,\n  rules: [robotsRule],\n};\n\nexport default defineConfig({\n  input: \"index.js\",\n  plugins: [\n    sitemap({\n      baseUrl: \"https://domain.com\",\n      urls: [url],\n      robots,\n    }),\n  ],\n  output: {\n    file: \"build/index.js\",\n    format: \"esm\",\n  },\n});\n```\n\n### ChangeFrequency\n\nThe `ChangeFrequency` type represents how often a page is likely to change. Possible values:\n\n- `\"always\"` - For pages that change every time they are accessed\n- `\"hourly\"` - For pages that change at least once an hour\n- `\"daily\"` - For pages that change at least once a day\n- `\"weekly\"` - For pages that change at least once a week\n- `\"monthly\"` - For pages that change at least once a month\n- `\"yearly\"` - For pages that change at least once a year\n- `\"never\"` - For archived pages that will never change again\n\n### Priority\n\nThe `Priority` type represents the importance of a page relative to other pages on your site. Possible values:\n\n- `0`, `0.1`, `0.2`, `0.3`, `0.4`, `0.5`, `0.6`, `0.7`, `0.8`, `0.9`, `1`\n\n## Contributing\n\nSee [`CONTRIBUTING.md`](./CONTRIBUTING.md).\n\n## License\n\nMIT License - see the [LICENSE](LICENSE) file for details.\n\n## Changelog\n\n### 1.0.1 (2026-03-13)\n\n#### Features\n\n- Added vitest testing framework with 100% code coverage\n- Added GitHub Actions workflows:\n  - Development workflow (lint + build on `development` branch)\n  - Production workflow (lint + test + coverage + build on `production` branch)\n- Added badges to README (npm, types, license, codecov)\n\n#### Documentation\n\n- Added testing commands to CONTRIBUTING.md\n- Added `test`, `test:watch`, and `test --coverage` scripts\n\n#### Fixes\n\n- Made `userAgent` optional in `RobotsRule` interface\n\n### 1.0.0 (2026-03-13)\n\n#### Breaking changes\n\n- Module format changed from CommonJS to ESM. If you were using CommonJS imports, update your imports to use ESM syntax.\n- The sitemap URL in `robots.txt` now includes the sitemap filename (e.g., `Sitemap: https://domain.com/sitemap.xml` instead of `Sitemap: https://domain.com`).\n\n#### Features\n\n- Added `path` option to customize the sitemap filename (e.g., `subcategory.sitemap.xml`)\n- Added full `robots.txt` generation support with custom rules including:\n  - `description` - Comment describing the rule\n  - `userAgent` - Which robot the rule applies to\n  - `allow` - URL paths allowed to be indexed\n  - `disallow` - URL paths disallowed from indexing\n- Added TypeScript type exports (`ChangeFrequency`, `Priority`, `Url`, `Robots`, `RobotsRule`)\n- Added `lint` script for TypeScript type checking\n\n#### Fixes\n\n- Fixed module export format to be ESM-compatible\n\n#### Documentation\n\n- Added comprehensive documentation for all new features\n- Added TypeScript types documentation\n- Updated contributing guidelines\n\n#### License\n\n- Changed from GPL-3.0 to MIT\n\n### 0.1.0\n\n- Initial release\n- Basic sitemap generation with `location`, `lastModified`, `changeFrequency`, and `priority` options\n- Basic `robots.txt` generation with sitemap URL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminnairi%2Frollup-plugin-sitemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faminnairi%2Frollup-plugin-sitemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminnairi%2Frollup-plugin-sitemap/lists"}