I am using TypeScript to create my nodejs application, which is working fine inasmuch as the index.ts
is being compiled and executed successfully, but the TypeScript files in subfolders are being ignored and don't form part of the dev watch.
Can anyone help out? I use yarn start
to run my app in dev mode. My scripts from package.json
look like this:
"scripts": {
"start": "yarn run build:live",
"build": "rm -rf dist && tsc",
"build:live": "nodemon --exec ./node_modules/.bin/ts-node -- ./src/index.ts"
}
And my tsconfig.json
looks like this:
{
"compilerOptions": {
"outDir": "dist",
"target": "es2017",
"module": "commonjs",
"sourceMap": true,
"noUnusedLocals": true,
"typeRoots": [
"node_modules/@types"
]
},
"include": [
"src/**/**.ts",
"test/**/**.ts"
],
"exclude": [
"node_modules"
]
}
I have tried using "build:live": "nodemon --exec ./node_modules/.bin/ts-node --project tsconfig.json"
as my dev script but this causes the compiler to hang.