fabiandev / ts-runtime

Runtime Type Checks for TypeScript

Home Page:https://fabiandev.github.io/ts-runtime/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: transform() input and output strings

andykais opened this issue · comments

Following up the discussion of #5, I have looked over instructions on building a loader, and I should be able to build a simple webpack loader that transforms certain files into runtime check files. Basically, the webpack loader will compile certain ts files with ts-runtime into javascript, then those files will be passed through ts-loader or awesome-typescript-loader as normal.

To make this work however, I need transform() to be able to take in a string and output a string or buffer. Webpack expects each loader to act this way, it is how we are able to chain loaders together. Is a change like this possible?

Hi @andykais, thanks for following up the discussion.
I will have a look asap and will get back to you!