tst-reflect icon indicating copy to clipboard operation
tst-reflect copied to clipboard

`import * as _Br from 'tst-reflect'` is added to every compiled file

Open avin-kavish opened this issue 3 years ago • 3 comments

and not just the ones that use it

avin-kavish avatar Aug 28 '22 13:08 avin-kavish

This is actually problem for front-end code, affects bundle size.

avin-kavish avatar Sep 06 '22 15:09 avin-kavish

This is added to each root/entry file. If you configure your tsconfig like include: "**/*.ts", all the matched files are meant as root files. Each of that file can be root/entry file. So it is important to add that to each such file.

If you change the include to "index.ts", TS knows this is only root/entry file, and it will follow imports to find all other application files.

I can add new option to config: rootFiles: string[].

Hookyns avatar Sep 06 '22 18:09 Hookyns

So it is important to add that to each such file.

why? The library is only needed when used

avin-kavish avatar Sep 07 '22 05:09 avin-kavish

Fixed in v1. Not in the current version.

Hookyns avatar Sep 29 '22 06:09 Hookyns