Skip to content

Commit 2265b72

Browse files
feat: support webpack built-in resolver for modern and modern-compiler API (#1197)
1 parent a975db2 commit 2265b72

21 files changed

+984851
-226492
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -664,9 +664,9 @@ Default: `"legacy"`
664664

665665
Allows you to switch between `legacy` and `modern` API. 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).
666666

667-
> **Warning**
667+
> **Note**
668668
>
669-
> "modern" API is experimental, so some features may not work (known: built-in `importer` is not working and files with errors is not watching on initial run), you can follow this [here](https://github.com/webpack-contrib/sass-loader/issues/774).
669+
> Using `modern-compiler` and `sass-embedded` together significantly improve performance and decrease built time. We strongly recommend their use. We will enable them by default in a future major release.
670670
671671
> **Warning**
672672
>

src/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ async function loader(content) {
5858
);
5959
} else {
6060
sassOptions.importers.push(
61-
getModernWebpackImporter(this, implementation),
61+
// No need to pass `loadPaths`, because modern API handle them itself
62+
getModernWebpackImporter(this, implementation, []),
6263
);
6364
}
6465
}

0 commit comments

Comments
 (0)