Open3

NestJS+swc環境でtsxをコンパイルできるようにする

Shoma ManoShoma Mano
nest-cli.json
{
  "$schema": "https://json.schemastore.org/nest-cli",
  "collection": "@nestjs/schematics",
  "sourceRoot": "src",
  "compilerOptions": {
    "deleteOutDir": true,
    "assets": ["**/*.html", "**/*.ttf"],
    "builder": {
      "type": "swc",
      "options": { "extensions": [".ts", ".tsx", ".js", ".jsx"] }
    },
    "typeCheck": true
  }
}

Shoma ManoShoma Mano
.swcrc
{
  "$schema": "https://json.schemastore.org/swcrc",
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "tsx": true
    },
    "transform": { "react": { "runtime": "automatic" } }
  },
  "sourceMaps": true
}