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

Can't pass paths via command-line #10137

Closed
nycdotnet opened this issue Aug 4, 2016 · 6 comments
Closed

Can't pass paths via command-line #10137

nycdotnet opened this issue Aug 4, 2016 · 6 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@nycdotnet
Copy link

As we're preparing to update grunt-ts to support TypeScript 2.0's features, it has come to our attention that it's not possible to pass paths via the command-line.

tsc --paths returns error TS6064: Option 'paths' can only be specified in 'tsconfig.json' file.

This is a problem for us as we only operate via the command-line and support a more dynamic experience via the Grunt options (which can be determined programmatically, etc.).

User @agubler reported this to us here: Issue: TypeStrong/grunt-ts#339

Is --paths not supported on the command-line just because it's hard to reliably accept JSON from the command-line? Would you consider a pull request to add this?

@evmar
Copy link
Contributor

evmar commented Aug 4, 2016

Any time you put information inside of a build config and not in the tsconfig.json, you break TypeScript's editor support (e.g. in this case, the editor also wants to know which files are built, so it can index their symbols). If your tool really wants to dynamically generate file lists, the most user-supportive thing to do would be to generate a tsconfig.json (and check it in to the project repo).

@nycdotnet
Copy link
Author

Hi,

I appreciate this feedback and I agree with your sentiment with regards to using source-controlled build artifacts.

That said, an important feature of tools like Grunt-ts is allowing developers to customize their build system to use a configuration that is different than their editing environment if they want to, and that's what I'm asking about.

@agubler
Copy link

agubler commented Aug 4, 2016

@evmar our use case the project tsconfig.json file is source controlled, but using grunt-ts to create variations from this base project file depending on the grunt configuration. The plain dev pipelines uses the tsconfig "as is" however for creating a the distribution we use different output and flags, additionally a user could also have pipelines for different targets (es5, es6 etc).

@mhegazy
Copy link
Contributor

mhegazy commented Sep 29, 2016

Is --paths not supported on the command-line just because it's hard to reliably accept JSON from the command-line?

sorry for the delayed reply. yes. it is only supported in tsconfig.json. so is roots

@mhegazy
Copy link
Contributor

mhegazy commented Sep 29, 2016

Would you consider a pull request to add this?

Not sure it is worth the hassle. we have to come up with a serialized format for paths, and that can be complicated, and very hard to read. unless you say it is JSON.

@mhegazy
Copy link
Contributor

mhegazy commented Sep 29, 2016

@agubler consider using the new configuration inheritance feature added in TS 2.1 instead.

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

4 participants