A few versions back, TypeScript exposed the customTransformer
API in its API.
I am interested in developing a transformer that can handle import statements (and maybe requires as well) in order to resolve bundle dependencies, similar to how webpack, browserify, or parcel operate.
Fortunately, TypeScript itself already utilizes a customTransformer API for a similar purpose:
transformAMDModule located at src/compiler/transformers/module/module.ts line 120
However, this code relies on internal fields/APIs and doesn't fully meet the requirements of my task.
Is it possible to accomplish this task using only public APIs, even if it's a simplified or partial version?
TO CLARIFY: I am referring to bundling the external dependencies of the application (such as react
, moment
, lodash
) along with the application code into a single large JavaScript file. While TypeScript
currently supports the --outFile
argument, it only combines the application code and not the dependencies.
P.S. I have also posted the same question on Twitter/486timetable. Any helpful updates will be shared here for easier searchability.