{
  "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": "..",
    "outDir": "../dist-server",
    "sourceMap": true,
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "skipLibCheck": true,
    "types": ["node"]
  },
  "include": ["./**/*.js", "./**/*.ts", "../shared/**/*.js", "../shared/**/*.ts"],
  "exclude": ["../dist", "../dist-server", "../node_modules", "../src"]
}
