Search Indexing

Projects published to a surge.sh subdomain are not indexed by search engines. Every surge.sh subdomain answers /robots.txt with:

# surge.sh subdomains are not indexed by search engines.
# Publish to a custom domain to serve this project's own robots.txt.
# https://surge.sh/docs/platform/search-indexing
User-agent: *
Disallow: /

This applies whether or not your project contains a robots.txt. Your file still publishes, but the surge.sh address serves the one above instead.

Getting indexed

Publish the project to a custom domain. Custom domains and their SSL certificates are free on every plan, and on a custom domain your project's own robots.txt (and a sitemap.xml it points to) is served exactly as published:

surge publish ./dist example.com

With no robots.txt in the project, a custom domain has no robots rules at all, and crawlers index it as normal.

Always excluded

Some addresses tell crawlers Disallow: / on any domain, custom ones included: