refactor(@angular/build): remove sass worker and fallback to pure-JS sass - #33942
Open
alan-agius4 wants to merge 2 commits into
Open
refactor(@angular/build): remove sass worker and fallback to pure-JS sass#33942alan-agius4 wants to merge 2 commits into
alan-agius4 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the Sass compilation logic by consolidating the separate worker-based and async-compiler implementations into a single, unified SassCompiler class. It also introduces the useSassEmbedded environment option to toggle between the native embedded compiler and the pure-JS fallback, simplifying the codebase and removing several files. The review feedback highlights a couple of redundant method bindings in the rebasing importer subclasses, where load and canonicalize are unnecessarily bound again despite already being bound in their parent constructors.
alan-agius4
force-pushed
the
refactor/sass-compiler-pure-js
branch
from
August 27, 2026 07:50
d2a2419 to
78ca8af
Compare
…sass Removes the legacy Piscina-based Sass worker thread pool implementation (`sass-worker-implementation.ts` and `worker.ts`). When the native `sass-embedded` compiler cannot be used (such as inside WebContainers or when disabled), the build system now directly falls back to the in-process pure-JS Dart Sass asynchronous compiler (`sass.initAsyncCompiler()`). Consolidates the Sass compilation logic in `packages/angular/build/src/tools/sass` into a simplified `SassCompiler` class in `sass-service.ts` supporting both rebasing (esbuild) and non-rebasing (Webpack) usage. Environment Variable: - Replaces `NG_BUILD_SASS_WORKER` with `NG_BUILD_SASS_EMBEDDED`. - When `NG_BUILD_SASS_EMBEDDED` is set to `0` or `false`, or when running within a WebContainer environment, the native embedded Sass compiler is disabled and the pure-JS Sass compiler is used instead.
alan-agius4
force-pushed
the
refactor/sass-compiler-pure-js
branch
from
August 27, 2026 07:56
78ca8af to
b8e9db4
Compare
alan-agius4
force-pushed
the
refactor/sass-compiler-pure-js
branch
2 times, most recently
from
August 27, 2026 08:29
99fe0d0 to
413c192
Compare
This `sass` version is only used for types, as the `sass` implementation is in `@angular/build`.
alan-agius4
force-pushed
the
refactor/sass-compiler-pure-js
branch
from
August 27, 2026 08:31
413c192 to
1b8c60d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Removes the legacy Piscina-based Sass worker thread pool implementation (
sass-worker-implementation.tsandworker.ts). When the nativesass-embeddedcompiler cannot be used (such as inside WebContainers or when disabled), the build system now directly falls back to the in-process pure-JS Dart Sass asynchronous compiler (sass.initAsyncCompiler()).Consolidates the Sass compilation logic in
packages/angular/build/src/tools/sassinto a simplifiedSassCompilerclass insass-service.tssupporting both rebasing (esbuild) and non-rebasing (Webpack) usage.Environment Variable
NG_BUILD_SASS_WORKERwithNG_BUILD_SASS_EMBEDDED.NG_BUILD_SASS_EMBEDDEDis set to0orfalse, or when running within a WebContainer environment (process.versions.webcontainer), the native embedded Sass compiler is disabled and the pure-JS Sass compiler is used instead.