Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrate existing angular project to standalone

my angular project was on version 13 and I migrated it step by step to angular 16. now I want to make it fully standalone and then migrate it to version 17.

Is there any utility that I can use or do I have to do it manually?

like image 696
MahdiJoon Avatar asked Jun 19 '26 06:06

MahdiJoon


1 Answers

You can migrate your angular project to standalone with this command:

ng generate @angular/core:standalone

As the docs say:

Run the migration in the order listed below, verifying that your code builds and runs between each step:

  1. Run ng g @angular/core:standalone and select Convert all components, directives and pipes to standalone
  2. Run ng g @angular/core:standalone and select Remove unnecessary NgModule classes
  3. Run ng g @angular/core:standalone and select Bootstrap the project using standalone APIs
  4. Run any linting and formatting checks, fix any failures, and commit the result

In my case, there was no error after the migration but in your case, they may occur and you need to fix them manually.

As the last step, you need to remove all the remaining modules manually from your project as they are useless now.

like image 185
MahdiJoon Avatar answered Jun 21 '26 19:06

MahdiJoon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!