Hookyns / tst-reflect

Advanced TypeScript runtime reflection system
MIT License
338 stars 11 forks source link

[Question] Vite support #87

Open pablolazaro opened 1 year ago

pablolazaro commented 1 year ago

Hi everyone,

First of all, thanks for the effort of building this library!

I'm looking forward to use it on a Vue project and I was wondering if anyone have some experience using it with a project powered by Vite. I know Vite uses esbuild behind the scenes and given that is not compatible with TypeScript transformers I have to switch to Rollup but, I haven't achieved to make it work properly.

Have any of you a good example of how to use it with Vite?

Thanks in advance!

lsarrazi commented 1 year ago

Up !

Hookyns commented 1 year ago

Hi, sorry idk how I missed this.

Neither Vite (esbuild) nor SWC are supported. I have a plan how to make it work, but it's a lot of work; alpha planned for 2024.

Rollup is TypeScript but it transpiles code in a different way so no full support is possible in current state and I didn't test it for a year so idk if it is still at least partly working. Last version of webpack and/or ts-loader seems to work similar to Rollup which means it is quite broken too. Things have been changing fast lately.

I work on new version (see https://github.com/Hookyns/tst-reflect/issues/78) , but because of all those changes I think I will switch to that whole new version which should get all the build and bundle tools working and it will be almost independent so it should be more durable.

Hookyns commented 1 year ago

I have officially started working on a new version which will make support of esbuild/Vite, SWC etc. possible. Each build system will require its own plugin but it'll be thin; all the hard work is gonna be done by main TS process.