Where to integrate code generation in dev-server command

31 views Asked by At

We are using the dev-server command from @angular-devkit/build-angular to run our TypeScrpt/Angular application locally on a development server with live reloading. This works quite well - whenever a file is changed, the compilation process is triggered and the updated application is served.

Now, we would like to integrate some code generation - that is, call some tools that generate a bunch of TypeScript files, which should then be included in the compilation. This should happen every time the build runs, obviously right before TypeScript compilation, while at the same time in such a way that the regenerated code files do not trigger an additional build/serve cycle due to containing changes.

So far, we have managed to auto-run our generation command, but either just after the build (i.e. too late), or right before it, but in the latter case, the build always appears to repeat once, which unnecessarily prolongs waiting time.

Is this possible with dev-server or do we have to create a modified version thereof?

0

There are 0 answers