Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

283
Views
How to get the JavaScript files to be in a different folder to the typescript files, using tsconfig.json? With outDir and rootDir?

My aim is to get the JavaScript file: helloWorld.js to pop up in the dist-folder, while the TypeScript file: helloWorld.ts stayed in the src folder. However the JavaScript file went to the src folder. I have tried setting the tsconfig.json to have the rootDir and the outDir as:

tsconfig.json:

{
  "compilerOptions": {
    "target": "es2016",
    "module": "commonjs",
    "rootDir": "./src",
    "outDir": "./dist",
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "skipLibCheck": true 
  }
}

And this is the result when I run this code in the cmd terminal in VSC

...\HelloWorld>tsc helloWorld.ts

File Directory

Is there something wrong with the way I have set up the config file?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!