5

I am trying to configure a custom-webpack.config.js to move some icons from a library to my assets with copyWebpackPlugin, I have created my custom-webpack.config.js file and this is my configuration in angular.json:

"architect": {
        "build": {
          "builder": "@angular-builders/custom-webpack:browser",
          "options": {
            "customWebpackConfig":{
              "path":"./custom-webpack.config.js",
              "replaceDuplicatePlugins":true
            },

and

"serve": {
          "builder": "@angular-builders/custom-webpack:dev-server",
          "options": {
            "browserTarget": "myProject:build"
          },

but when running ng serve or ng build, I am getting this error:

Job name "..getProjectMetadata" does not exist.
Error: Job name "..getProjectMetadata" does not exist.

these are my Angular libraries:

"@angular/animations": "^8.0.0",
    "@angular/cdk": "^8.0.1",
    "@angular/common": "^8.0.0",
    "@angular/compiler": "^8.0.0",
    "@angular/core": "^8.0.0",
    "@angular/forms": "^8.0.0",
 "@angular-builders/custom-webpack": "^9.0.0",
    "@angular-builders/dev-server": "^7.3.1",
    "@angular-devkit/build-angular": "^0.803.23",
    "@angular/cli": "8.0.0",
    "@angular/compiler-cli": "^8.0.0",
    "@angular/language-service": "^8.0.0",

any ideas?

2 Answers 2

3

I ran in to the same issue, and the suggestion above still resulted in an error.

In addition to using @angular-devkit/[email protected], try also "@angular-builders/custom-webpack": "8.4.1".

I honestly can't explain why this works, I just noticed that the earliest version of angular-builders/custom-webpack that didn't depend on the newer (Broken) version of build-angular worked, and allowed me to import the working version.

Sign up to request clarification or add additional context in comments.

Comments

1

It seems to be an issue with @angular-devkit/build-angular so downgrade your version to this:

npm i @angular-devkit/[email protected]

1 Comment

even after installing that version for angular-devkit/build-angular, same error remains.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.