-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[1.0] gatsby-plugin-typescript fails without tsconfig.json #840
Comments
Thanks for bring this up! It seems a sensible solution would be for the plugin to check if /cc @noahlange and @fabien0102 |
I'm use to have a @Aendrew I'm actually working on a gatsby-starter (including typescript), If you want to test/contribute, your are welcome 😃 |
Whoops. Thanks for picking this up, @fabien0102. I have a tsconfig.json file in all of the TS projects I work on, so I just never ran into this. You may need to update the webpack config. |
I will try something like that ^^ |
From tsloader docs I tried some configurations but you can't pass files options (so it's failed to find any files). And it's important to have tsconfig.json for your IDE ;) I will just update the doc (and add ts-loader into dependencies) |
What did you think about auto-writing out a tsconfig.json if it's missing?
…On Sun, Apr 23, 2017, 1:37 PM Fabien BERNARD ***@***.***> wrote:
The tsconfig.json file controls TypeScript-related options so that your
IDE, the tsc command, and this loader all share the same options.
From tsloader docs
I tried some configurations but you can't pass files options (so it's
failed to find any files). And it's important to have tsconfig.json for
your IDE ;)
I will just update the doc (and add ts-loader into dependencies)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#840 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEVh_CkRlf3BRhxnK2_mCssF8iMlVgmks5ry7ahgaJpZM4NFQA2>
.
|
@KyleAMathews Just overkill for instant ^^ |
Cool :-) and it looks like people need a fairly custom tsconfig.json file anyways for Gatsby so pushing them that way is necessary right? |
tsconfig.json needs to be on root directory (for your IDE), and it's cool for add libs/rules easily. I just said that a simple copy/past of the example file into README.md should be good enough for instant. (the must to have should be a |
Apologies for the delay getting back to this — totally valid point about having |
Thanks! Though that's been @fabien0102 who's been tending the typescript docs. |
From the docs it seemed as if all that needed to be done to get
gatsby-plugin-typescript
working is to install the dependencies and add an entry togatsby-config.js
— however, if you don't also create atsconfig.json
file,gatsby develop
throws the following:A workaround is running:
./node_modules/.bin/tsc --init
in the root of a project.It'd be cool if one wasn't necessary and all TypeScript config could just be done in
gatsby-config.js
.The text was updated successfully, but these errors were encountered: