I am starting with typescript. I started with an empty folder and ran these commands to set up my typescript development.
npm init
npm install typescript
npm install @types/node
then i made a tsconfig file
npx tsc --init
I tried changing my output dir in tsconfig.json like "outDir": "./dist",
But that doesn't seem to work. the transpiled file is still coming into the src folder. I have a folder structure like :
root
|_ node_modules
|_ src
|_ index.ts
|_ dist
|_package.json
|_tsconfig.json
|_package-lock.json
Here is the tsconfig.json file
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}