fabiospampinato / typescript-transform-export-interop

TypeScript transform for exporting a module that can be easily imported both from TypeScript and from Node.js.
MIT License
3 stars 0 forks source link

Use TypeScript Transform Plugin instead of regexes #1

Open phra opened 6 years ago

phra commented 6 years ago

This module uses regexes for transforming your export, instead of modifying the AST (there isn't a Babel equivalent for TypeScript declarations, is there?) so you should be careful not to write weird things like strings containing export default Foo, they will throw off this module.

have a look at these blog posts:

fabiospampinato commented 6 years ago

Awesome, thanks for the suggestion!

fabiospampinato commented 6 years ago

There's a small problem with using TypeScript's AST:

Possible solutions:

I'll have to think more about this 🤔

phra commented 6 years ago

have a look at https://github.com/urish/typewiz, it's written in typescript too.

fabiospampinato commented 6 years ago

I've just realized that's actually a non-issue, dev dependencies aren't installed along with the package 🤦‍♂️

phra commented 6 years ago

:smile: