fix(angular): add workaround to prevent process from exiting early when building #5807
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ISSUES CLOSED: #5729
Current Behavior
When building an Angular app with Nx using the
@angular-devkit/build-angular
, since version12.0.1
there's a new implementation for the SASS compilation which uses workers to do the job. The implementation unref the worker early and that causes, in some environments (CI, Docker builds, where no TTY is available), to exit the process too early, and therefore, no compilation occurs. The Angular CLI is working because they rely (intentionally or not) on asetInterval
running for analytics while the compilation is occurring, which keeps the event loop busy and prevents the process from exiting.Expected Behavior
Building an Angular app with Nx should work correctly. A workaround is added (an empty interval) to keep the event loop busy, until the Angular CLI fixes the way workers are managed.
Related Issue(s)
Fixes #5729