question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

webpack.config.js not found even if customWebpackConfig is not set

See original GitHub issue

Describe the bug I just want to merge extra webpack config for production build. So I only config the production options, but for development build, it runs into errors: webpack.config.js not found

Builder:

Libraries

  • angular-devkit/build-angular: 0.12.3

Expect Ignore when customWebpackConfig is not set

Additional context My angular.json config is like

"build": {
          "builder": "@angular-builders/custom-webpack:browser",
          "options": {
            "outputPath": "dist/mall/browser",
            "index": "projects/mall/src/index.html",
            "main": "projects/mall/src/main.ts",
            "polyfills": "projects/mall/src/polyfills.ts",
            "tsConfig": "projects/mall/tsconfig.app.json",
            "sourceMap": true,
            "assets": [
              "projects/mall/src/favicon.ico",
              "projects/mall/src/assets"
            ],
            "styles": [
              "projects/mall/src/styles.scss"
            ],
            "scripts": [],
            "statsJson": true
          },
          "configurations": {
            "production": {
              "customWebpackConfig": {
                "path": "extra-webpack.config.js",
                "mergeStrategies": { "devtool": "replace" }
              }
         }

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
just-jebcommented, Feb 28, 2019

Yeah, indeed a use case that I missed. You’re welcome to PR (it’s just adding a default value in schema).
Meanwhile the workaround is to create an empty config for development and specify it in options.

0reactions
chaoyangnzcommented, Mar 9, 2019

Would you mind trying version 7.4.3?

Tried. it works. thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack.config.js not found even if customWebpackConfig is ...
Describe the bug I just want to merge extra webpack config for production build. So I only config the production options, ...
Read more >
customWebpackConfig not working in ng build --prod in Angular
So I added to my angular.json : "build": { "builder": "angular-cli-builders:custom-webpack- ...
Read more >
How To Use Custom webpack Configurations with Angular ...
Learn how to create a custom webpack config inside an Angular project using CLI Builders. This example will reduce the file size of...
Read more >
Externals - webpack
The externals configuration option provides a way of excluding dependencies from the output bundles. Instead, the created bundle relies on that dependency ...
Read more >
Webpack Plugin — JSDefender User Guide 2.6
As a result, JSDefender will not be able to use your inline protection settings. ... The following webpack.config.js code snippet utilizes the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found