You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create strongly-typed JSON files by generating a .d.json.ts for each one I need strong types for (until we get importing JSON as const).
tsup doesn't seem to skip these files when generating DTS and instead assumes they're a TS file to be built, but then dies on the declare const syntax.
DTS Build error
Unexpected token (Note that you need plugins to import files that are not JavaScript)
1: declare const abi: [
^
2: {
3: "type": "function",
(oddly this nice error shows up for tsup version ^6.7.0 but not ^8.2.4 and instead only shows "DTS Build error" with no details)
I've tried to work around this with various ignore/exclude options, but nothing seems to work. The TS maintainers suggest that tsup is missing support for the .d.{extension}.ts format enabled by allowArbitraryExtensions (see conversation in microsoft/TypeScript#49703 (comment)).
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
We receive the funding once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.
The text was updated successfully, but these errors were encountered:
Enabling
allowAbitraryExtensions
defines DTS files as.d.{extension}.ts
.I'm trying to create strongly-typed JSON files by generating a
.d.json.ts
for each one I need strong types for (until we get importing JSONas const
).tsup doesn't seem to skip these files when generating DTS and instead assumes they're a TS file to be built, but then dies on the
declare const
syntax.(oddly this nice error shows up for tsup version ^6.7.0 but not ^8.2.4 and instead only shows "DTS Build error" with no details)
I've tried to work around this with various ignore/exclude options, but nothing seems to work. The TS maintainers suggest that tsup is missing support for the
.d.{extension}.ts
format enabled byallowArbitraryExtensions
(see conversation in microsoft/TypeScript#49703 (comment)).Upvote & Fund
The text was updated successfully, but these errors were encountered: