0.0.0-placeholder • Published 2 years ago

madras v0.0.0-placeholder

Weekly downloads
12
License
ISC
Repository
github
Last release
2 years ago

Next, install typescript along with tsc-watch for running our server every time source files have been changed. $ npm i typescript tsc-watch The solution with tsc-watch is elegant, it uses tsc -w under the hood, and once TS compiler has compiled all changes. It will restart our server. Let’s change scripts section in package.json with this: "scripts": { "dev": "tsc-watch --onSuccess \"node ./dist/server.js\"" } Before we run it, we have to create a config for TypeScript compiler. $ npx tsc --init --moduleResolution node --resolveJsonModule --target es6 --noImplicitAny --sourceMap --lib dom,es2017 --outDir dist We use npx — an npm package runner for running locally, installed packages, tsc in our case. Now we have a tsconfig.json file in the project root directory.