Skip to content
Advertisement

Typescript development environment

I am starting with typescript. I started with an empty folder and ran these commands to set up my typescript development.

JavaScript

then i made a tsconfig file

JavaScript

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 :

JavaScript

Here is the tsconfig.json file

JavaScript

Advertisement

Answer

Just use tsc. You just specify one file. TypeScript doesn’t worry about making it work as a module by itself as you don’t have a need for modules with just one file. Oh also, from the cli reference:

Transpile just the index.ts with the compiler defaults tsc index.ts

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement