TmTron
TmTron

Reputation: 19381

How to use different tsconfig file for tests?

in my project I use 2 different tsconfig files

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

Notes:

enter image description here

Upvotes: 8

Views: 2004

Answers (1)

TmTron
TmTron

Reputation: 19381

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

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

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

enter image description here

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:
    i.e. it is important that you use include/exclude in each of the tsconfig files, so that only the relevant files are compiled

Upvotes: 2

Related Questions