Skip to content

Commit 3bb06c3

Browse files
committedMay 28, 2024·
fix(@angular/build): disable Worker wait loop for Sass compilations in web containers
The Sass Worker by default uses an Atomics-based wait loop to improve performance while waiting for messages. This loop relies on the synchronous API `receiveMessageOnPort`. While this works well in Node.js, the web container execution environment does not currently support passing transferable objects via `receiveMessageOnPort`. Closes: #27723 (cherry picked from commit c9644c9)
1 parent de8d703 commit 3bb06c3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

Diff for: ‎packages/angular/build/src/tools/sass/sass-service.ts

+3
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ export class SassWorkerImplementation {
9595
filename: require.resolve('./worker'),
9696
minThreads: 1,
9797
maxThreads: this.maxThreads,
98+
// Web containers do not support transferable objects with receiveOnMessagePort which
99+
// is used when the Atomics based wait loop is enable.
100+
useAtomics: !process.versions.webcontainer,
98101
// Shutdown idle threads after 1 second of inactivity
99102
idleTimeout: 1000,
100103
recordTiming: false,

0 commit comments

Comments
 (0)
Please sign in to comment.