I've successfully target my Angular dist folder in my Nest application using ServeStaticModule. However, I noticed that when changes made to Angular the hot reload doesn't work as if Nest doesn't detect the new build compilation from Angular even the dist file is detected. Am I missing or misunderstood something the concept of ServeStaticModule?
Project Structure:
project-folder
├── angular
│ `-- dist
| `--app-name
│ `-- index.html
│
├── nest
│ `-- src
│ `-- app.module.ts
app.module.ts
@Module({
imports: [
ServeStaticModule.forRoot({
rootPath: join(
__dirname,
"..",
"..",
"..",
"angular/dist/app-name/"
),
exclude: ["/api*"],
}),
HelloModule,
],
controllers: [],
providers: [],
})
package.json (angular): angular 14.2.0
"build": "ng build",
"watch": "ng build --watch --configuration development"
package.json (nest): nest 8.0.0
"start": "nest start",
"start:dev": "nest start --watch",
How I run my project:
npm run watchfor angularnpm run start:devfor nest