当我在NestJs中运行npm run start:dev
时,它的工作方式是这样的:
10:00:00 AM - Starting compilation in watch mode...
10:00:10 AM - Found 0 errors. Watching for file changes.
Debugger listening on ws://127.0.0.1:9229/0cb76900-3b46-4f68-82c0-ea78ed36f327
For help, see: https://nodejs.org/en/docs/inspector
[Nest] 3932 - 03/06/2020, 10:00:23 AM [NestFactory] Starting Nest application...
[Nest] 3932 - 03/06/2020, 10:00:23 AM [InstanceLoader] JwtModule dependencies initialized +41ms
[Nest] 3932 - 03/06/2020, 10:00:23 AM [InstanceLoader] ConfigHostModule dependencies initialized +2ms
[Nest] 3932 - 03/06/2020, 10:00:23 AM [InstanceLoader] ConfigModule dependencies initialized +2ms
但是当我更改代码时,它没有被重建。它就像这样显示:
10:40:27 AM - File change detected. Starting incremental compilation...
10:40:27 AM - Found 0 errors. Watching for file changes.
有人可以帮我修复它吗?非常感谢。
const app = await NestFactory.create(AppModule);
希望有帮助!