Skip to content

browser-esbuild builder doesn't clean output path before building #26308

Closed
@atsjo

Description

@atsjo

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

16.2.10

Description

output path isn't cleared before building with @angular-devkit/build-angular:browser-esbuild, as it is with @angular-devkit/build-angular:application and @angular-devkit/build-angular:browser.

and setting deleteOutputPath=true doesn't work either...

this makes old build artifacts accumulate in the output, since chunks get a new hash for every change...

I could migrate to using application builder, but that puts the browser build in it's own sub-dir, with 3rdpartylicenses.txt in the parent folder (which is linked in my web-app)...

Minimal Reproduction

  1. setup project with browser-esbuild
  2. build
  3. make a change in the app
  4. build
  5. observe output with old hashed chunks

Exception or Error

No response

Your Environment

Angular CLI: 17.0.0
Node: 20.9.0
Package Manager: yarn <error>
OS: win32 x64

Angular: 17.0.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.0 (cli-only)
@angular-devkit/build-angular   17.0.0
@angular-devkit/core            17.0.0
@angular-devkit/schematics      17.0.0
@angular/cdk                    17.0.0
@angular/cli                    17.0.0
@angular/fire                   17.0.0-next.0
@angular/material               17.0.0
@schematics/angular             17.0.0
ng-packagr                      17.0.0
rxjs                            7.8.1
typescript                      5.1.6
zone.js                         0.14.2

Anything else relevant?

I'm using nx, and the reported Package Manager above is wrong...
Using the application builder works, but then I must manipulate the build output before deploying. The docs also states that deleteOutputPath can be set, but it's not working...

   Node   : 20.9.0
   OS     : win32-x64
   pnpm   : 8.10.2

   nx                 : 17.1.1
   @nx/js             : 17.1.1
   @nx/jest           : 17.1.1
   @nx/linter         : 17.1.1
   @nx/eslint         : 17.1.1
   @nx/workspace      : 17.1.1
   @nx/angular        : 17.1.1
   @nx/cypress        : 17.1.1
   @nx/devkit         : 17.1.1
   @nx/esbuild        : 17.1.1
   @nx/eslint-plugin  : 17.1.1
   @nrwl/tao          : 17.1.1
   @nx/web            : 17.1.1
   @nx/webpack        : 17.1.1
   typescript         : 5.1.6
   ---------------------------------------
   Community plugins:
   angular-calendar : 0.31.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions