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

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

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

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

# https://localhost/redirect3.ts
HEADERS: {"location":"./value.ts"}

# https://localhost/value.ts
console.log('hi');

# 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
              }
            }
          }
        },
        {
          "specifier": "https://localhost/other_redirect.ts",
          "code": {
            "specifier": "https://localhost/other_redirect.ts",
            "resolutionMode": "import",
            "span": {
              "start": {
                "line": 1,
                "character": 7
              },
              "end": {
                "line": 1,
                "character": 44
              }
            }
          }
        }
      ],
      "size": 86,
      "mediaType": "TypeScript",
      "specifier": "file:///mod.ts"
    },
    {
      "kind": "esm",
      "size": 19,
      "mediaType": "TypeScript",
      "specifier": "https://localhost/value.ts"
    }
  ],
  "redirects": {
    "https://localhost/other_redirect.ts": "https://localhost/redirect2.ts",
    "https://localhost/redirect.ts": "https://localhost/redirect2.ts",
    "https://localhost/redirect2.ts": "https://localhost/redirect3.ts",
    "https://localhost/redirect3.ts": "https://localhost/value.ts"
  }
}
