Open jdeniau opened 4 years ago
I saw that the inject method does inject prop-types into a file content, but the file content need to be a JS file, not a TS one.
It can be any valid source code, you just need to provide it the babel plugins to be able to understand it https://github.com/merceyz/typescript-to-proptypes/blob/d02a08a7f4c7a25e08c786fa8b625d838613c8b5/src/injector.ts#L45-L48
Do you think it would be possible to externalize this plugin to make a "real" babel plugin ?
Sure, that should be possible
Hi,
I found your repo, that looks really efficient to generate prop-types.
I saw that the
inject
method does inject prop-types into a file content, but the file content need to be a JS file, not a TS one.The Javascript reality is that build is really complex and babel does really simplify it.
As a matter of facte, I saw that you do have a babel plugin that injects proptypes into the AST, that is called by the
inject
method. But it has it's own configuration, of babel.Do you think it would be possible to externalize this plugin to make a "real" babel plugin ?
The idea behind that is to have a babel config like that:
thank you !