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
π The bug
What isn't working? Describe what the bug is.
π οΈ To reproduce
Create src/types.d.ts
Inside src/index.ts:
export * from './types'
siroc build:
[UNRESOLVED_IMPORT] Could not resolve './types' from src/index.ts
π Expected behaviour
Types exportable from .d.ts files
βΉοΈ Additional context
We can fix this issue by renaming types to types.ts or using export type {} from './types' (with .d.ts). Downside of first is that it is not semantic and types are not usable in typescript config and for second, when there are lots of types, named exports are hard. BTW not sure even this is something fixable by siroc but tought mentioning if there is a workaround.
The text was updated successfully, but these errors were encountered:
Interesting question. I'm not sure we should be able to import/export dts files. I think we should always be operating with .ts files and generating the dts files in the build stage.
danielroe
changed the title
fix:
support importing/exporting .d.ts files
Feb 7, 2021
@danielroe of course we should never include .d.ts in import path to match runtime. Issue is that with siroc we cannot export from .d.ts files even when there is no extension in import path and forced to use .ts :)
Interesting question. I'm not sure we should be able to import/export dts files. I think we should always be operating with .ts files and generating the dts files in the build stage.
This is not always best option. src/dts files are can be usable for linked demo and tests in their tsconfig. Otherwise we need to force a dry build step or add duplicate shims
π The bug
What isn't working? Describe what the bug is.
π οΈ To reproduce
src/types.d.ts
src/index.ts
:siroc build
:π Expected behaviour
Types exportable from
.d.ts
filesβΉοΈ Additional context
We can fix this issue by renaming types to
types.ts
or usingexport type {} from './types'
(with .d.ts). Downside of first is that it is not semantic and types are not usable in typescript config and for second, when there are lots of types, named exports are hard. BTW not sure even this is something fixable by siroc but tought mentioning if there is a workaround.The text was updated successfully, but these errors were encountered: