create-caspar-graphics icon indicating copy to clipboard operation
create-caspar-graphics copied to clipboard

Add support for typescript in templates

Open jeansson opened this issue 7 years ago • 1 comments

This is great stuff! It would be awesome to have support for TypeScript as well, maybe by passing "--lang" ts or something like that. This will generate a templates->example->index.ts instead and would use the ts compiler instead of babel i guess. If that is not an option maybe this could be: https://blogs.msdn.microsoft.com/typescript/2018/08/27/typescript-and-babel-7/

jeansson avatar Oct 16 '18 14:10 jeansson

Thanks!

Supporting TypeScript would be really nice. But we don't use it ourselves so I don't see us working on adding support for it anytime soon. I'd love a PR though!

There's currently an open PR in the create-react-app repo about adding support for TS. The idea is basically to automatically detect TS by looking at the extension. Maybe this would be even easier now with blogs.msdn.microsoft.com/typescript/2018/08/27/typescript-and-babel-7?

The way Razzle solves it is by allowing customizations to the webpack config. I've been thinking about doing the same, since it really opens up a lot of options.

Regardless of the approach, I think having a "lang" option when running create would be a good idea!

What do you think?

tobiasandersen avatar Oct 19 '18 08:10 tobiasandersen

This is now supported.

tobiasandersen avatar Jan 02 '24 11:01 tobiasandersen