|
|
|
|
|
by penpapersw
3255 days ago
|
|
Hey this is pretty great, thanks! Dunno why I didn't consider it to be that simple. But it really is working. Well, along with `npm install @types/node --save` which I found somewhere else, so it quits complaining about 'require' not being found. |
|
You are right, I forgot about installing typings. Instead of require you should use ES6 "import" (which TS compiles to require anyway) to get more type checking. But when you do that you'll see more of my missed step, which is `npm install @types/XYZ` for each XYZ package you use.
As soon as you start introducing a separate build tool (like gulp or whatever) things get super messy super fast but not for any interesting reason. Using `tsc --watch` also means it does caching across builds so it's faster than using gulp unless you're careful to configure it.