Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify a specific tsconfig.json in WebStorm

WebStorm by default takes the tsconfig.json in the root directory of a project. Is there any way that we can point this to custom tsconfig.json file path using the settings?

I can see the options in TypeScript section of WebStorm settings, but I cannot figure out the correct way to specify tsconfig.json.

like image 420
gauravmuk Avatar asked Mar 28 '18 07:03

gauravmuk


2 Answers

You can use the -p option of the tsc command.

On webstorm, click on configure (the wrench)

enter image description here

Then add -p yourTsConfig.json in the Options field.

enter image description here

like image 155
Flavien Volken Avatar answered Nov 14 '22 23:11

Flavien Volken


If Recompile on changes is enabled in Preferences | Languages & Frameworks | TypeScript, it uses the nearest tsconfig.json current file is included in, scanning folders from the file folder up to the project root. If it's disabled, you can compile using Compile button in Typescript tool window toolbar - when pressing this button, you can choose a tsconfig.json to be used for compilation

enter image description here

like image 43
lena Avatar answered Nov 15 '22 00:11

lena