Ionic Generate Page Issue with Angular Standalone

I am building Ionic 7.2.0/Angular/ngModule apps. Recently I found that once I use command line “Ionic g page page_name”, it always fails the compiling with the generated page with the following error message:

“error NG6008: Component PageName is standalone, and cannot be declared in an NgModule. Did you mean to import it instead?”

This issue was not there when I create new pages a few month earlier. I further investigated and found that I can add “standalone: false,” to @Component part in the page_name.page.ts file to fix the issue. However, it is very inconvenient to add such a statement for each new page I create. Is it possible to fix “Ionic generate” to avoid the error generated by default? Thanks!

You need to write your own Node.js script that watches for newly generated files and automatically adds standalone: false to the component decorator.