plopjs / plop

Consistency Made Simple
http://plopjs.com
MIT License
7.06k stars 277 forks source link

Supporting plopfile.ts .ts extension #416

Closed WildOsk closed 5 months ago

WildOsk commented 7 months ago

I have read some threads on github about this but i dont get what to do.

I receive the following error you already know:

[PLOP] Something went wrong with reading your plop file TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"

David-Tsui commented 6 months ago

You can compile it to js manually. the module option might different between repos. If not working, please refer to ts compiler options.

/** package.json */
"scripts": {
  "build-plop": tsc --module nodenext ./plopfile.ts --outDir . && prettier --write ./plopfile.js
}
WildOsk commented 6 months ago

But i guess at some point this will be supported natively(?) without needing to compile it first?

amwmedia commented 6 months ago

I think @crutchcorn has done quite a bit of work on getting this working. I believe it's close.

WildOsk commented 6 months ago

Good to know it's close 🙌🏼

crutchcorn commented 5 months ago

Apologies, closing as a dupe of #297