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

Resolve references using tsconfig?? #2868

Closed
niemyjski opened this issue Apr 22, 2015 · 10 comments
Closed

Resolve references using tsconfig?? #2868

niemyjski opened this issue Apr 22, 2015 · 10 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@niemyjski
Copy link

Currently you need to do a main references file when dealing with multiple typescript files. This can become a pain to manage. Could we just use the files from tsconfig.json or better yet use all typescript files in all directories under where the resolved tsproject.json is found.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 22, 2015

This is the semantics of tsconfig.json. by adding an empty tsconfig to your directory, all .ts files in this directory will be considered part of a "project". you can build using tsc --p or just tsc in your root directory.
alternatively you can specify a set of files in the tsconfig file and build the same way.

@mhegazy mhegazy added the Question An issue which isn't directly actionable in code label Apr 22, 2015
@niemyjski
Copy link
Author

Yes, but what I'm talking about is not having to do
/// <reference path="../references.ts" /> in every file.. this is really annoying.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 22, 2015

you are talking about building or the editing experience in VS?

@niemyjski
Copy link
Author

In this case editing but I'd think it should work for both. The problem is when you have tsconfig.json files... then, I'd want to be able to select the configuration I'm working on in my editor much like debug / release in vs.. Otherwise default to all files in that folder.

@niemyjski
Copy link
Author

That's why I think it would be nice to support a naming convention where you have:

  • \tsconfig-es5.json
  • \tsconfig-es6.json

and then you could apply those rules under the specific target (es5 or es6)..

@mhegazy
Copy link
Contributor

mhegazy commented Apr 22, 2015

tsconfig support is not in VS yet. it should be in soon though. Until this is done you would want to keep your /// references to keep your editing experience in VS.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 22, 2015

@niemyjski can you file a suggestion making "--p" take a full path to tsconfig.json as well as a directory. (i.e. check if it is a file, use it if not look for tsconfig.json within that directory).

@niemyjski
Copy link
Author

Yes, I'll make this suggestion. Do you think I should add a request for making it also support tsconfig.json first and if it can't find one it looks for the first tsconfig*.json?

@mhegazy
Copy link
Contributor

mhegazy commented Apr 22, 2015

I would say only file support in --p. this way we do not have to worry about order, when there are multiple ones

@mhegazy
Copy link
Contributor

mhegazy commented Jun 12, 2015

looks like this is already tracked by #2869.

@mhegazy mhegazy closed this as completed Jun 12, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 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

2 participants