I have two folders: TypeScript and JavaScript. I need to compile the TypeScript file which are in TypeScript folder to JavaScript files in the JavaScript folder.
Asked
Active
Viewed 614 times
0
-
Use the building tool of your preference. (grunt, gulp, ...) – Shilly Sep 26 '16 at 15:27
-
@Shilly Thanks alot :D – Sep 26 '16 at 15:29
-
The way to do this is to read the manual. Or you could google "typescript target directory". Or you could search SO for answers like [this](http://stackoverflow.com/questions/24454371/typescript-how-to-keep-compiled-files-in-a-separate-directory). – Sep 26 '16 at 17:48
2 Answers
-1
Add a tsConfig.json file to the root of your TypeScript project. One option to the compiler is outDir
which specifies the output directory. See: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
{
"compilerOptions": {
"outDir": "./JavaScript"
},
"files": ["./TypeScript/**/*.ts"]
}

Hampus
- 2,769
- 1
- 22
- 38
-
-
@an0nh4x0r It should be in the root of your TypeScript project. See https://www.typescriptlang.org/docs/handbook/tsconfig-json.html – Hampus Sep 27 '16 at 07:13