Skip to content

Define build option does not define values for prebundling #29278

Closed

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

Activity

  1. alan-agius4 commented on Jan 8, 2025

    @alan-agius4
    Collaborator

    Actually this is slightly different.

  2. added a commit that references this issue on Jan 8, 2025
    cb52eab
  3. added a commit that references this issue on Jan 8, 2025
    1f2481a
  4. added a commit that references this issue on Jan 8, 2025
    8639a3b
  5. angular-automatic-lock-bot commented on Feb 8, 2025

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  6. locked and limited conversation to collaborators on Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions