Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tsc command not compiling to outDir

I am pretty new to tsconfig.json configuration, but I am simply wanting to compile my src directories to compiled javascript like it should, but it's just not creating the outDir folder with the compiled code.

This is my tsconfig.json:

{
  "compilerOptions": {
    "module": "commonjs",
    "esModuleInterop": true,
    "target": "es2017",
    "skipLibCheck": true,
    "noImplicitAny": true,
    "noEmit": true,
    "moduleResolution": "node",
    "sourceMap": true,

    "outDir": "dist",

    "baseUrl": ".",
    "jsx": "react",
    "paths": {
      "MyApplicationTypes" : ["@types/MyApplicationTypes/index.d.ts"],
      "*": [
        "node_modules/*"
      ]
    },
    "typeRoots" : ["@types"]
  },
  "include": [
    "server/**/*",
    "client/**/*"
  ],
  "exclude" : [
    "./client/dist",
    "./client/.cache",
    "./dist",
    "./.cache"
  ]
}

My npm run build command is just plain tsc and it runs and completes without any errors or any other output.

The dist/ does not created and even if I create the folder manually, it stays empty. What is going on?!

My folder structure is pretty simple containing both a server and client:

- project
  - client
    - index.html
    - index.tsx
    ... etc
  - server
    - index.ts 
    ... etc

Any reason why? My tsconfig is pretty simple

like image 851
Zac Avatar asked Nov 09 '25 02:11

Zac


1 Answers

You have noEmit set to true. As said here, noEmit is used for type checking only.

For more information check TS docs.

like image 94
Shivam Singla Avatar answered Nov 10 '25 15:11

Shivam Singla



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!