简体   繁体   中英

How to use different tsconfig file for tests?

in my project I use 2 different tsconfig files

  • tsconfig.json
  • tsconfig.specs.json - for testing

how can I tell Intellij Idea to use both?
ie In Settings - Langauges & Frameworks - TypeScript I can switch between different Compile scope s, but the Options are not per compile scope (but only once per project).

Notes:

在此处输入图片说明

I think we only need to register the file-types:

In Settings | Editor | File Types > TypeScript Config add your custom tsconfig file names, eg

  • tsconfig.app.json
  • tsconfig.lib.json
  • tsconfig.spec.json
  • etc.

在此处输入图片说明

With these settings in place:

  • IntelliJ should show syntax highlighting and completion suggestions in your tsconfig files
  • the IntelliJ typescript service should recognize all these tsconfig files and compile everything:
    ie it is important that you use include/exclude in each of the tsconfig files, so that only the relevant files are compiled

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM