{
  "compilerOptions": {
    "target": "ES2022",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "lib": ["ES2022"],
    // baseUrl is the project root (one level above this config file) so that tsc-alias
    // resolves @/ imports relative to the compiled output structure in dist-server/server/.
    // With rootDir ".." tsc emits server files under dist-server/server/, so paths must
    // include the "server/" prefix to match that layout.
    "baseUrl": "..",
    "paths": {
      "@/*": ["server/*"]
    },
    // The backend is still mostly JavaScript today, so allowJs lets us add a real
    // TypeScript build without forcing a large rename before the tooling is usable.
    "allowJs": true,
    // Keep the migration incremental: existing JS keeps building, while any new TS files
    // still go through the normal TypeScript pipeline and strict checks.
    "checkJs": false,
    "strict": true,
    "noEmitOnError": true,
    // The backend build emits both /server and /shared into dist-server, so rootDir must
    // stay one level above this file even though the config itself now lives in /server.
    "rootDir": "..",
    // The build stages into dist-server.next; scripts/promote-dist-server.mjs
    // (postbuild:server) swaps it into dist-server once tsc and tsc-alias have
    // both finished. Never emit into the live dist-server: an interrupted build
    // must not be able to destroy the build the server is running from.
    "outDir": "../dist-server.next",
    "sourceMap": true,
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "skipLibCheck": true,
    "types": ["node"]
  },
  "include": ["./**/*.js", "./**/*.ts", "../shared/**/*.js", "../shared/**/*.ts"],
  "exclude": ["../dist", "../dist-server", "../dist-server.next", "../dist-server.old", "../node_modules", "../src"]
}
