Migrating a project using @angular-builders/custom-webpack to NX

155 Views Asked by At

I'm trying to migrate an Angular project that currently uses the "@angular-builders/custom-webpack build targets to an integrated NX monorepo and during the execution of npx nx@latest init --integrated I get the following warning:

  • Unsupported builders:
    • Errors:
      • The "build" target is using a builder "@angular-builders/custom-webpack:browser" that's not currently supported by the automated migration. The target will be skipped.
      • The "serve" target is using a builder "@angular-builders/custom-webpack:dev-server" that's not currently supported by the automated migration. The target will be skipped.
      • The "test" target is using a builder "@angular-builders/custom-webpack:karma" that's not currently supported by the automated migration. The target will be skipped.
    • Make sure to manually migrate the target configuration and any possible associated files. Alternatively, you could revert the migration, change the builder to one of the builders supported by the automated migration ("@angular-devkit/build-angular:application", "@angular-devkit/build-angular:browser", "@angular-devkit/build-angular:browser-esbuild", "@angular-devkit/build-angular:protractor", "@cypress/schematic:cypress", "@angular-devkit/build-angular:extract-i18n", "@nguniversal/builders:prerender", "@angular-devkit/build-angular:prerender", "@angular-devkit/build-angular:dev-server", "@angular-devkit/build-angular:server", "@nguniversal/builders:ssr-dev-server", "@angular-devkit/build-angular:ssr-dev-server", "@angular-devkit/build-angular:karma" and "@angular-eslint/builder:lint"), and run the migration again.

what should I do about it?

1

There are 1 best solutions below

0
Francesco Borzi On

It looks like all I had to do was manually fixing the project.json file inside apps/my-app/ and specifically I had to change all values such as:

someConf: "src/...",

to:

someConf: "apps/my-app/src..."

I also had to manually fix the "extends": property of several tsconfig.xxx.json files (moved by NX) pointing to the right base file (which has been renamed to tsconfig.base.json by NX).

It surprises me that these were not done automatically by nx (using version 18.0.4)