Skip to content

Commit

Permalink
feat: support webpack built-in resolver for modern and `modern-comp…
Browse files Browse the repository at this point in the history
…iler` API (#1197)
  • Loading branch information
alexander-akait authored Apr 11, 2024
1 parent a975db2 commit 2265b72
Show file tree
Hide file tree
Showing 21 changed files with 984,851 additions and 226,492 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,9 +664,9 @@ Default: `"legacy"`

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).

> **Warning**
> **Note**
>
> "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).
> 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.
> **Warning**
>
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ async function loader(content) {
);
} else {
sassOptions.importers.push(
getModernWebpackImporter(this, implementation),
// No need to pass `loadPaths`, because modern API handle them itself
getModernWebpackImporter(this, implementation, []),
);
}
}
Expand Down
Loading

0 comments on commit 2265b72

Please sign in to comment.