Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ng update with @angular-builders/custom-webpack #1342

Open
wszydlak opened this issue Feb 17, 2023 · 1 comment
Open

Using ng update with @angular-builders/custom-webpack #1342

wszydlak opened this issue Feb 17, 2023 · 1 comment
Labels

Comments

@wszydlak
Copy link

Describe the Bug

Currently, doing ng update will not migrate applications properly when using @angular-builders/custom-webpack. This is due to @angular/cli migrations are checking if builder target is @angular-devkit/build-angular.

This issue is related to angular/angular-cli#24741 - there are more informations.

@just-jeb
Copy link
Owner

Hey @wszydlak, thanks for bringing this up.
Undoubtedly the right way to go is to add this capability to the builder. I also assume it wouldn't be that huge of an effort if you extend Angular CLI's schematics. If you want to submit a PR, it would be most appreciated.

For the meanwhile, a tolerable workaround for those who struggle with this issue:

  1. Copy @angular-builders/custom-webpack specific properties from the config JSON to some other place.
  2. Replace @angular-builders/custom-webpack builder target with @angular-devkit/build-angular (while removing the @angular-builders/custom-webpack specific properties).
  3. Run ng update.
  4. Replace @angular-devkit/build-angular build target with @angular-builders/custom-webpack.
  5. Add @angular-builders/custom-webpack specific properties back to the config JSON.

Since @angular-builders/custom-webpack is by all means an extension to @angular-devkit/build-angular, all the changes that apply to the latter also apply to the former, so they should be applied on one hand and they shouldn't hurt anything on another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants