我在根目录中创建了一个公共文件夹来存储用户上传的文件。但是在npm run start:dev
模式下,每次上传文件时,Nest 都会检测到文件更改并重新启动服务器。我该怎么做才能避免这种情况?谢谢。
目录结构:
-project
-dist
-src
-public
-(other files)
Run Code Online (Sandbox Code Playgroud)
Pri*_*abo 16
在tsconfig.json
下面的属性之后立即包含以下exclude
属性
"include": [ "src"]
Run Code Online (Sandbox Code Playgroud)
内部tsconfig.json
文件执行我在以下示例中所做的操作:
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"paths": {
}
},
"exclude": [
"node_modules",
"dist",
"public" <<-- Add the folder name here to exclude from updates
]
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4124 次 |
最近记录: |