Skip to content

Define build option does not define values for prebundling #29278

Closed
@HazzMan2409

Description

@HazzMan2409

Command

serve

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

No response

Description

The define build option is not passed on for prebundling https://github.com/angular/angular-cli/blob/main/packages/angular/build/src/tools/vite/utils.ts#L101 and so library code that relies on a global variable being set cannot be prebundled.

Minimal Reproduction

Pre-bundle a library that relies on a global.

Exception or Error


Your Environment

Angular CLI: 19.0.6
Node: 20.12.1
Package Manager: npm 10.5.0
OS: darwin arm64

Angular: 19.0.5
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1900.6
@angular-devkit/build-angular   19.0.6
@angular-devkit/core            19.0.6
@angular-devkit/schematics      19.0.6
@angular/cli                    19.0.6
@schematics/angular             19.0.6
rxjs                            7.8.1
typescript                      5.6.3
zone.js                         0.15.0

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions