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 for tsc --p option? (path to project) #168

Closed
spacejack opened this issue Jul 31, 2016 · 5 comments
Closed

Support for tsc --p option? (path to project) #168

spacejack opened this issue Jul 31, 2016 · 5 comments

Comments

@spacejack
Copy link

spacejack commented Jul 31, 2016

I'd like to be able to supply the path to the tsconfig.json file, but tsify doesn't seem to pass this through to tsc.

Eg:

browserify src/main.ts -p [ tsify --p src ] -o public/js/app.js

So it won't pick up any of the options in tsconfig.json, meaning I have to re-add them to the command line. This gets especially bad when you have a lot of typings files as you can't include them with a wildcard. Eg:

browserify src/main.ts src/typings/lib1/lib1.d.ts src/typings/lib2/lib2.d.ts src/typings/lib3/lib3.d.ts -p [ tsify --noImplicitAny --noImplicitReturns --suppressImplicitAnyIndexErrors ] -o public/js/app.js

Is there a way to set the path to tsconfig.json?

@cartant
Copy link
Contributor

cartant commented Jul 31, 2016

Try something like this:

browserify src/main.ts -p [ tsify --project some/path/tsconfig.json ] -o public/js/app.js

@spacejack
Copy link
Author

Oh that's great! That seems to be working, thank you!

@basarat
Copy link
Member

basarat commented Aug 2, 2016

Documented by @cartant Thanks again ! 👍 🌹

@basarat basarat closed this as completed Aug 2, 2016
@cartant
Copy link
Contributor

cartant commented Aug 2, 2016

@basarat Actually, it seems that I've missed the author's intentions re: tsc options:

You can point to a different tsconfig.json with the --project another-tsconfig.json option. (This is not called out explicitly in the README because it's a feature of tsc.)

I'll submit another PR later to tidy up the README.md, as --project is not an 'extra option'; its a tsc option that's supported by tsify. Also, I think I'll add support for the tsc option short names - like -p. If tsify is going to behave like tsc option-wise, I think it should support the short names. If it had, this issue would not have arisen.

@cartant
Copy link
Contributor

cartant commented Aug 3, 2016

@basarat Unfortunately, my change to expand the short-name, command-line options resulted in the target defaulting to ES3, so I'm going to have to make another release - with some code that's somewhat more robust.

It's a little embarrassing, that the first release for which I've been responsible is broken. Clearly, I'll have to have a closer look at the testing environment the author has set up, so that I can add some tests that cover additions like the one I've just made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants