【发布时间】:2020-08-08 10:42:56
【问题描述】:
当我的src/ 文件夹的子目录中的文件发生更改时,nodemon 不会对其更改做出反应,但会在项目中的其他文件更改时做出反应。
Screenshot of the folder structure
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"]
}
【问题讨论】:
-
不要在标题中添加标签,它应该读成一个句子。
-
拜托,如果您可以将所有内容作为文本发布,而不是屏幕截图,例如文件夹结构可以很容易地从
tree命令的输出中复制粘贴。 -
When files inside subdirectories of the src/ are changed, nodemon won't react.这不是很清楚,你能否把你的问题说得更具体一点。 -
编辑了您帖子的格式。
-
谢谢@ruohola,我欠你一杯啤酒
标签: typescript next.js nodemon