Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

build-optimizer: "logical OR" property assignment is removed #388

@devversion

Description

@devversion

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request

Area

- [X] devkit
- [ ] schematics

Versions

`-- @angular/[email protected]
  `-- @angular-devkit/[email protected]

node -v // 8.5.0
npm -v // 5.5.1

Repro steps

Clone this reproduction repository and run the app in two different ways:

  • With the build optimizer (using -prod --aot)
  • Without the build optimizer (using -prod --aot --build-optimizer=false)

problemexplanation

The highlighted code snippet here (picture from the ESM 5 file button.js file) is being removed when running with the build optimizer. If you add a console.log before, the console.log stays, just the specific code snippet is being removed.

Switching to a ternary, or simple if-else will fix the issue.

with build-optimizer disabled
image

_with build-optimizer enabled
image

Mention any other details that might be useful

Related to Angular Material. angular/components#9360

cc. @filipesilva

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions