tspath icon indicating copy to clipboard operation
tspath copied to clipboard

Not substitue path in d.ts

Open shenghu opened this issue 6 years ago • 6 comments

My code is something like this dist/ src/ index.ts hello.ts

where index.ts contains

export * from 'src/hello';

In dist/, after running tspath, index.d.ts still contains

export * from 'src/hello';

shenghu avatar Jul 13 '18 07:07 shenghu

Currently, definition files are not supported, there is a new version 2 coming very soon, this release is a very serious release which will contain support for definitions among many other frequently requested features.

duffman avatar Nov 14 '18 07:11 duffman

Hi @duffman, when is this release coming? We're 5 months further and you said "Very soon" I just ran into this exact same issue when trying out tspath (loving the tool by the way, great work). I cannot use it without definition file support though.

barthuijgen avatar Apr 23 '19 08:04 barthuijgen

@barthuijgen if it helps you, or anyone, this can be done via ttypescript + @zerollup/ts-transform-paths. Here's a working example config -note that the config extends a tsconfig.json file, which in turns extends a jsconfig.json containing the paths. Then just call ttsc instead of tsc -works as a drop-in replacement.

rafamel avatar Apr 23 '19 09:04 rafamel

Thanks @rafamel, I tried out your solution, and while it does seem to output correct files in my dist, it also produces a lot of typescript build errors of "module not found", I'm unsure which repository to submit this as an issue to. tspath sofar works the best for me, except not transforming .d.ts files :(

barthuijgen avatar Apr 23 '19 11:04 barthuijgen

@duffman some news about it?

ReactiioN1337 avatar Nov 10 '19 05:11 ReactiioN1337

any news on this ? @duffman

searleser97 avatar Jul 06 '21 02:07 searleser97