-
Notifications
You must be signed in to change notification settings - Fork 522
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
resolveJsonModule doesn't work #1109
Comments
Matter of fact it does but it requires some configuration in tsconfig.json file. Like so
Keep in mind this is just a workaround. worked well in my case. |
I'm surprised that workaround works because I thought ts_library restricts inputs |
Yeah, it doesn't work (because of the reason both @alexeagle and I mentioned). |
I think it hsould be reasonable to allow |
Shouldn't |
Wouldn't this be blocked anyway due to the use of the UMD module type? Typescript doesn't allow resolveJsonModule with UMD. https://github.com/microsoft/TypeScript/pull/26825/files#diff-942ae3cd2a8bbd85ed86a60cd7c43307R7015 (I can't imagine why .. we are talking about static json files here, it shouldn't be this hard right).
Our tsconfig.json has Then, I set about patching this in to your rules (I couldn't add .json into src). Eventually, I think I got that right, the symlinks are finally there and valid. But still the json files weren't resolved during compilation, despite now being in place. [I could publish this patch if interested, I believe it's close though I didn't update tests. It was at least useful for me to gain more of an understanding of how bazel works .. inputs and outputs]. Now I see I forgot about the setting in the tsconfig. I put that back, and now despite my efforts to patch I am still blocked, due to the above with UMD. I suppose I will try creating a json.d.ts file as described here https://stackoverflow.com/a/40473566 and try to move on. |
I was able to get around it by creating a
It's possible I may have had to do that anyway and it's unrelated to I now see that the 'devmode_module' option is there, I didn't explore setting this to non umd to see if resolveJsonModule + my patch actually worked. But, for sure it would be nice if |
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs! |
I believe this is fixed |
yeah your #1995 I think, thanks |
Yeah sorry still true for ts_library. |
I took a shot at it for ts_library, without necessarily needing to touch the code coming out of Let me know what y'all think, we'll probably use a local branch of this for the time-being. |
If I'm on 3.0.0-rc.1 what's the right way to use I think I'm able to do it via Rollup, but would like to have the concatjs_devserver also working. |
@tomasdev which rule are you using that doesn't understand the json import? |
@alexeagle hey! thanks, I'm tracking it under #2365 -- it has an isolated test scenario as well (this ticket is about |
This issue has been automatically marked as stale because it has not had any activity for 90 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs! |
This issue was automatically closed because it went two weeks without a reply since it was labeled "Can Close?" |
🐞 bug report
Affected Rule
ts_library
Is this a regression?
No.
Description
resolveJsonModule
is not supported.ts_library supports only .ts and .tsx sources.
https://www.typescriptlang.org/docs/handbook/compiler-options.html
The text was updated successfully, but these errors were encountered: