install nodemon typescritp
npm i -D typescript ts-node nodemon @types/node
install nodemon typescritp
npm i -D typescript ts-node nodemon @types/node
nodemon typescript
// nodemon.json
{
"watch": ["src"],
"ext": "ts",
"exec": "ts-node ./src/app.ts"
}
// package.json
{
"dev": "concurrently \"nodemon .\" \"tsc -w\""
}
using nodemon with typescript
nodemon --watch "src/**" --ext "ts,json" --ignore "src/**/*.spec.ts" --exec "ts-node src/index.ts"
typescript with nodemon
watch that video, very useful
add this to your scripts object in package.json:
"start:ts": "tsc -w",
"start:js": "nodemon build/index.js",
"start": "concurrently npm:start:*"
in tsconfig.json uncomment "rootDir" and "outDir"
assuming your ts files will be in '/src' and
your js files compiled to '/build', change the configs to:
"rootDir": "./src",
"outDir": "./build",
make sure you have typescript, nodemon, and concurrently installed either
in your project, or globally
then, in your project folder, run in terminal: 'npm start'
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us