# mod.ts
import "https://localhost/redirect.ts";

# https://localhost/redirect.ts
HEADERS: {"location":"./redirect2.ts"}

# https://localhost/redirect2.ts
HEADERS: {"location":"./redirect.ts"}

# output
{
  "roots": [
    "file:///mod.ts"
  ],
  "modules": [
    {
      "kind": "esm",
      "dependencies": [
        {
          "specifier": "https://localhost/redirect.ts",
          "code": {
            "specifier": "https://localhost/redirect.ts",
            "resolutionMode": "import",
            "span": {
              "start": {
                "line": 0,
                "character": 7
              },
              "end": {
                "line": 0,
                "character": 38
              }
            }
          }
        }
      ],
      "size": 40,
      "mediaType": "TypeScript",
      "specifier": "file:///mod.ts"
    },
    {
      "specifier": "https://localhost/redirect2.ts",
      "error": "Too many redirects."
    }
  ],
  "redirects": {
    "https://localhost/redirect.ts": "https://localhost/redirect2.ts",
    "https://localhost/redirect2.ts": "https://localhost/redirect.ts"
  }
}
