Skip to content

Option to do not override "target" and "useDefineForClassFields" #24009

@e-oz

Description

@e-oz

Command

build, serve

Description

There are reasons why you've added this warning:

TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and "false" respectively by the Angular CLI. To control ECMA version and features use the Browerslist configuration. For more information, see https://github.com/browserslist/browserslist

To control ECMA version and features use the Browerslist configuration

There is no way to define target and useDefineForClassFields in the Browerslist configuration.

Please provide some option to skip target and useDefineForClassFields overriding - some projects are not ready for ES2022 and they are too big to modify overnight (or in a few weeks) to be compatible with ES2022, although they are still compatible with Angular 15 itself.

Describe the solution you'd like

Just quick ideas:

--keep-target-value --keep-use-defined-value

and

"targets": {
    "build": {
      "executor": "@angular-devkit/build-angular:browser",
      "options": {
          "keepTargetValue": true,
          "keepUseDefinedValue": true
       }
   }
}

Describe alternatives you've considered

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: repro stepsWe cannot reproduce the issue with the information given

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions