#TIL 7 - Use tsconfig.json for ts-node

Oct 8, 2020 · Dung Huynh

What

Add ts-node-specific configuration to your existing tsconfig.json.

Why

ts-node may need different compiler options than your build (e.g., CommonJS for runtime execution).

How

{
  "ts-node": {
    "compilerOptions": {
      "module": "commonjs"
    }
  },
  "compilerOptions": {
    // Your project config
  }
}