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

Improve development support: tsconfig files/exclude #7400

Closed
unional opened this issue Mar 5, 2016 · 1 comment
Closed

Improve development support: tsconfig files/exclude #7400

unional opened this issue Mar 5, 2016 · 1 comment
Labels
Question An issue which isn't directly actionable in code

Comments

@unional
Copy link
Contributor

unional commented Mar 5, 2016

Currently tsconfig.json is used both by tsc and typescript language service for IDE support.

The tsconfig.json need by tsc and typescript language service could be different:

  • For tsc, files: [] works just fine and actually have better control on what should be published
  • For typescript language service, exclude: [] works much better because when adding new file, you either need to:
    • Add the file to files: []
    • Reference by another file that can be resolved from files: []

Also, when package author write tests also in TypeScript, he may not want to have the tests be compiled and published along with source code.

I couldn't find a way to achieve this.

There are a few possible solutions:
a. add devExclude/devFiles in tsconfig.json. typescript language service will use this list if available.
b. Allow typescript language service to be configurable to use another config file, e.g. tsconfig.dev.json
c. Allow tsc to be configurable that by default use another config file, e.g. tsconfig.build.json

I'm aware that I can do tsc -p <directory>, but that wouldn't solve case where .ts and .spec.ts live in the same folder. Also, that's extra typing. The best case is to run tsc at project root and everything will just work.

Is there a .typescriptrc file available to add these options?

@blakeembrey
Copy link
Contributor

So, c. I believe is currently supported - you can now have two tsconfig.json files and point using -p, but IDE plugins have not caught up. Also, there's the proposal for include that allows the .spec.ts files to also be compiled alongside (excited for this one to land).

References: #5980 and #4883.

@mhegazy mhegazy closed this as completed Mar 29, 2016
@mhegazy mhegazy added the Question An issue which isn't directly actionable in code label Mar 29, 2016
@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
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

3 participants