Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens to the outDir in tsconfig.json for Angular projects?

I have added Angular to my Node Express app in VS Code. I did this through Angular CLI's ng new.

In tsconfig.json, outDir points to ./dist/out-tsc. There is another outDir in angular-cli.json.

When I run ng build, Javascript files are generated in the outDir indicated in angular-cli.json. What is the outDir in tsconfig.json for? The folder ./dist/out-tsc was not created.

like image 359
Old Geezer Avatar asked Apr 03 '18 03:04

Old Geezer


People also ask

What is the purpose of using tsconfig JSON file?

What is the purpose of using tsconfig.json file ? tsconfig.json file is a file of JSON format which allows us to point the root level files and different compiler options to setup that require to compile a TypeScript based projects. The existence of this file in a project specifies that the given directory is the TypeScript project folder root.

Are updates to tsconfig JSON undocumented in angular 9?

Angular 9 Upgrade updates to tsconfig.app.json are undocumented. · Issue #37168 · angular/angular · GitHub Sign up for free to subscribe to this conversation on GitHub . Already have an account? Sign in .

Can a tsconfig file be completely empty?

A tsconfig.json file is permitted to be completely empty, which compiles all files included by default (as described above) with the default compiler options. Compiler options specified on the command line override those specified in the tsconfig.json file.

What is tsconfig in typescript?

What is a tsconfig.json 1 Overview. The presence of a tsconfig.json file in a directory indicates that the directory is the root of a TypeScript project. 2 Using tsconfig.json or jsconfig.json. ... 3 Examples. ... 4 TSConfig Bases. ... 5 Details. ... 6 TSConfig Reference. ... 7 Schema. ...


1 Answers

What is the outDir in tsconfig.json for?

Nothing if using AngularCLI. The angular.json (.angular-cli.json prior to Angular 6) file controls the output configuration.

As indicated by:

The folder ./dist/out-tsc was not created.

If you use VS Code file watchers to compile your TS files on the fly/on request, then the tsconf.json file location will be used (depending on VSCode config of course). You can probably surmise that using one method or the other is a good idea. You may run into versioning difficulty if you use a combination of both methods.

Stick to the CLI.

like image 161
Randy Casburn Avatar answered Sep 30 '22 05:09

Randy Casburn