๐Ÿค– Robots

January 7, 2026 ยท View on GitHub

It creates simplified robots.txt for your Angular project. ๐Ÿš€

๐Ÿ“‹ Example Output

User-agent: *

Allow: /

Sitemap: https://www.mydomain.com/sitemap.xml

or

User-agent: *

Disallow: /

๐Ÿš€ Quick Start

๐Ÿ“ Add to angular.json

{
  ...,
  "projects": {
    "your-project-name": {
      ...,
      "architect": {
        ...,
        "robots": {
          "builder": "ngx-devkit-builders:robots",
          "options": {
            "sitemap": "https://www.mydomain.com/sitemap.xml",
            "verbose": false
          },
          "configurations": {
            "production": {
              "allow": true
            },
            "development": {
              "allow": false
            }
          }
        }
      }
    }
  }
}

โ–ถ๏ธ Run the builder

# Production configuration (allows crawling)
ng run your-project-name:robots:production

# Development configuration (disallows crawling)
ng run your-project-name:robots:development

โš™๏ธ Options

OptionTypeDefaultDescription
sitemapstring-URL to sitemap.xml
allowboolean-Whether to allow or disallow web crawling
verbosebooleanfalseShow detailed output