-
Notifications
You must be signed in to change notification settings - Fork 18
[codegen] improve importing types from generated file #86
Comments
FYI: This will never work with Yarn 2 |
And when my plugin had used this approach by default before, TypeScript did detect changes in node_modules rather slower than in src. (in VSCode, not sure it's IDE dependent) |
ha, forgot about that.. thanks for the reminder! @cometkim |
@d4rekanguok I haven't confirmed if this will work or not but here's an idea:
As far as I know, i think it's possible to create a packages for tsconfigs. So I think users would have tsconfig files that would look like this: {
"extends": "gatsby-ts/tsconfig",
"compilerOptions": {
// ...
},
// ...
} And our base config would include a |
@ricokahler That's a nice idea, I'll give it a try locally! |
@d4rekanguok you should checkout the typegen plugin. Since v2, I've moved generated type definitions into a specific namespace declaration, TypeScript will understand the definition without importing module. NexusJS also has a similar approach with this and they have great DX with code generation. |
Thanks @cometkim, I'll check it out v2 & also nexusJS! |
This way user can just import the file directly
Instead of the
../../..
they're doing now.Also avoid the confusion shown in #85
The text was updated successfully, but these errors were encountered: