You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add `"auto"` to the `api` option and make it the default. When the Sass implementation supports the modern compiler, `"auto"` enables it and reuses a single long-running compiler across files, which significantly improves build performance; otherwise it falls back to the `modern` API.
Copy file name to clipboardExpand all lines: README.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -657,16 +657,18 @@ module.exports = {
657
657
Type:
658
658
659
659
```ts
660
-
typeapi="modern"|"modern-compiler";
660
+
typeapi="auto"|"modern"|"modern-compiler";
661
661
```
662
662
663
-
Default: `"modern"` for `sass` (`dart-sass`) and `sass-embedded`
663
+
Default: `"auto"` for `sass` (`dart-sass`) and `sass-embedded`
664
664
665
665
Allows you to switch between the `modern` and `modern-compiler` APIs. You can find more information [here](https://sass-lang.com/documentation/js-api). The `modern-compiler` option enables the modern API with support for [Shared Resources](https://github.com/sass/sass/blob/main/accepted/shared-resources.d.ts.md).
666
666
667
+
When `"auto"` is used, the loader picks `"modern-compiler"` whenever the implementation exposes `initAsyncCompiler` (i.e. recent versions of `sass` and `sass-embedded`) and falls back to `"modern"` otherwise. Combined with `sass-embedded`, this yields the best build performance out of the box.
668
+
667
669
> [!NOTE]
668
670
>
669
-
> Using `modern-compiler` and `sass-embedded` together significantly improves performance and decreases build time. We strongly recommend their use. We will enable them by default in a future major release.
671
+
> Using `modern-compiler` and `sass-embedded` together significantly improves performance and decreases build time. They are now selected automatically by the default `"auto"` API.
0 commit comments