Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(utils): skip ngcc processing in ng16 or higher #2063

Merged
merged 1 commit into from
May 5, 2023
Merged

feat(utils): skip ngcc processing in ng16 or higher #2063

merged 1 commit into from
May 5, 2023

Conversation

chimurai
Copy link
Contributor

@chimurai chimurai commented May 5, 2023

Summary

Make ngcc processing optional.

  • Run ngcc for Angular < 16
  • Skip ngcc for Angular >= 16

fixes #1987
related #2058
related #2061

Test plan

Used patched jest-preset-angular in local Angular 16 project.

image

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Copy link
Collaborator

@ahnpnl ahnpnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ocombe
Copy link

ocombe commented May 9, 2023

Just FYI you could use import {VERSION} from '@angular/core'; and then VERSION.major to get the version number 16, I know that it's not technically the compiler cli version, but since you are supposed to use the same version number for all angular packages (otherwise it would fail anyway), that's a good way to get the version of Angular (better than parsing the package.json file)

edit: I checked and @angular/compiler-cli also exports VERSION, so you can directly use that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: NGCC Processor Throwing Error in Angular 16
3 participants