Когда файлы внутри подкаталогов моей папки src/
изменены, nodemon
не будет реагировать на их изменения, однако будет реагировать при изменении других файлов в проекте.
Снимок экрана структуры папок
package.json
:
"dev": "nodemon src/server.ts",
nodemon.json
: *
{
"watch": [".babelrc", "public/locales/**/*.json", "next.config.js", "src/server.ts"],
"exec": "ts-node --project tsconfig.server.json"
}
ts.config.server.json
:
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"target": "es2017",
"noEmit": false,
"outDir": "build/"
},
"include": ["src/server.ts"]
}
и ts.config.json
:
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"jsx": "preserve",
"lib": ["dom", "es2017"],
"baseUrl": ".",
"moduleResolution": "node",
"strict": true,
"allowJs": true,
"noEmit": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"skipLibCheck": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"isolatedModules": true,
"removeComments": false,
"preserveConstEnums": true,
"sourceMap": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true
},
"exclude": ["dist", ".next", "out", "next.config.js"],
["next-env.d.ts", "**/*.ts", "**/*.tsx"]
}