Hookyns/tst-reflect

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

avin-kavish opened this issue · 4 comments

and not just the ones that use it

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

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[].

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

why? The library is only needed when used

Fixed in v1. Not in the current version.