DelSkayn / rquickjs

High level bindings to the quickjs javascript engine
MIT License
440 stars 59 forks source link

JS transpiler hook #129

Open stevefan1999-personal opened 1 year ago

stevefan1999-personal commented 1 year ago

I need to hook the loader like this article: https://glebbahmutov.com/blog/hooking-into-node-loader-for-fun-and-profit/

I'm not sure if there is an API for that. More specifically I want it so that all files that ends in .ts or .tsx will get a SWC transpiler pass to strip the type information -- without having to go though a tsc transpile beforehand.

It would also be pretty useful if you want to get ES2022/ESNext code to transpile down to ES2020 for compatibility's sake.

I'm very confident about the performance of SWC (https://swc.rs/docs/benchmarks) so an async API is optional.

I need to transpile all modules -- regardless whether it is from a file or from a remote source.

katyo commented 1 year ago

Related pr #133