react-docgen-typescript icon indicating copy to clipboard operation
react-docgen-typescript copied to clipboard

Question: can `parse` method accept source code as argument

Open javaxiu opened this issue 2 years ago • 0 comments

I want to make a webpack loader to transpile a typescript file to doc , which means parser will accept code as argument but not filepath:

module.exports.default = function (source) {
  return reactDocGenTs(source);
}

sure I can pass resourcePath like parse(this.resourcePath) but it will lead to a fs IO and slow down the webpack build time. any sugguestion ?

javaxiu avatar Jun 06 '22 03:06 javaxiu