Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple tsconfig files for different environments #8500

Closed
SonofNun15 opened this issue May 6, 2016 · 6 comments
Closed

Support multiple tsconfig files for different environments #8500

SonofNun15 opened this issue May 6, 2016 · 6 comments
Labels
Duplicate An existing issue was already created Fixed A PR has been merged for this issue

Comments

@SonofNun15
Copy link

Most tools allow you to specify a specific configuration file if desired. For example, with Karma, the default config file is karma.conf.js, but you can pass a different file to the command line to target a different file. This lets you have multiple configurations for different environments.

The primary use case for this is test environments. Often the compilation settings and more specifically the files (type definitions!) included are very different.

When the test environment has to share the same tsconfig with the application, sometimes ambient type definitions for test libraries have to be included with the application build. This could easily result in a spyOn() jasmine call passing the application build and failing hard at run time.

It would be really nice to have a tsconfig.tests.json next to the application tsconfig.json.

@KorinaGraber
Copy link

+1

@JoshDSommer
Copy link

+2

@kitsonk
Copy link
Contributor

kitsonk commented May 6, 2016

Dupe of #6109

@mhegazy
Copy link
Contributor

mhegazy commented May 6, 2016

this is already supported today. --p argument can be a folder (implicitly meaning tsconfig.json) or a filename, to which you can pass whatever file you need.

see https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#the---project--p-flag-can-now-take-any-file-path for more details.

@mhegazy mhegazy closed this as completed May 6, 2016
@mhegazy mhegazy added Fixed A PR has been merged for this issue Duplicate An existing issue was already created labels May 6, 2016
@SonofNun15
Copy link
Author

Might I suggest an improvement to the documentation then? It is very unclear that -p can refer to a file. Believe me, I looked. 😀

mhegazy added a commit to microsoft/TypeScript-Handbook that referenced this issue May 6, 2016
Update documentation to point the option of using a file name as referenced in microsoft/TypeScript#8500
@mhegazy
Copy link
Contributor

mhegazy commented May 6, 2016

updated in microsoft/TypeScript-Handbook@fdd9621

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

5 participants