Enable debug logs in `ng build`
Asked Answered
P

2

6

How do I enable debug logs in ng build ? I want to see what the basePath is. The snippet below is from program_based_entry_point_finder.js.

node_modules\@angular\compiler-cli\ngcc\src\entry_point_finder\program_based_entry_point_finder.js

    ProgramBasedEntryPointFinder.prototype.walkBasePathForPackages = function (basePath) {
        var _this = this;
        this.logger.debug("No manifest found for " + basePath + " so walking the directories for entry-points.");
        var entryPoints = utils_1.trackDuration(function () { return _this.entryPointCollector.walkDirectoryForPackages(basePath); }, function (duration) { return _this.logger.debug("Walking " + basePath + " for entry-points took " + duration + "s."); });
        this.entryPointManifest.writeEntryPointManifest(basePath, entryPoints);
        return entryPoints;
    };
  • Tried to pass --verbose and --configuration="development" without success.

    ng build --verbose --configuration="development"

  • Angular configuration specification doesn't seem to have any option to change log level. https://angular.io/guide/workspace-config

Prepossession answered 26/10, 2021 at 18:30 Comment(0)
B
1
"build": {
      "builder": "@angular-devkit/build-angular:browser",
      "options": {
        "verbose": true
       }
}

Then build using:

ng build --verbose
Badmouth answered 28/7, 2023 at 21:34 Comment(1)
Thank you for contributing to the Stack Overflow community. This may be a correct answer, but it’d be really useful to provide additional explanation of your code so developers can understand your reasoning. This is especially useful for new developers who aren’t as familiar with the syntax or struggling to understand the concepts. Would you kindly edit your answer to include additional details for the benefit of the community?Latish
L
2

If you are using angular 17 then below is the command to check logs during the build

ng build -c production --verbose

Lophobranch answered 19/5 at 8:56 Comment(0)
B
1
"build": {
      "builder": "@angular-devkit/build-angular:browser",
      "options": {
        "verbose": true
       }
}

Then build using:

ng build --verbose
Badmouth answered 28/7, 2023 at 21:34 Comment(1)
Thank you for contributing to the Stack Overflow community. This may be a correct answer, but it’d be really useful to provide additional explanation of your code so developers can understand your reasoning. This is especially useful for new developers who aren’t as familiar with the syntax or struggling to understand the concepts. Would you kindly edit your answer to include additional details for the benefit of the community?Latish

© 2022 - 2024 — McMap. All rights reserved.