madras v0.0.0-placeholder
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.
2 years ago
4 years ago
4 years ago
4 years ago
4 years ago