Skip to content

Commit

Permalink
docs: update (#1242)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait authored Oct 21, 2024
1 parent a874a36 commit eda8505
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ module.exports = {

Finally run `webpack` via your preferred method.

### The `outputStyle` (old API) and `style` (new API) options in `production` mode
### The `style` (new API, by default since 16 version) and `outputStyle` (old API) options in `production` mode

For `production` mode, the `outputStyle` (old API) and `style` (new API) options default to `compressed` unless otherwise specified in `sassOptions`.
For `production` mode, the `style` (new API, by default since 16 version) and `outputStyle` (old API) options default to `compressed` unless otherwise specified in `sassOptions`.

### Resolving `import` at-rules
### Resolving `import` and `use` at-rules

Webpack provides an [advanced mechanism to resolve files](https://webpack.js.org/concepts/module-resolution/).

Expand Down Expand Up @@ -296,13 +296,13 @@ Options for [Dart Sass](http://sass-lang.com/dart-sass) or [Node Sass](https://g
> [!NOTE]
>
> The `indentedSyntax` option is `true` for the `sass` extension.
> The `syntax` (new API, by default since 16 version)`and`indentedSyntax`(old API) option is`scss`for the`scss`extension,`indented`for the`sass`extension and`css`for the`css` extension.
> [!NOTE]
>
> Options such as `data` and `file` are unavailable and will be ignored.
> ℹ We strongly discourage changing the `outFile`, `sourceMapContents`, `sourceMapEmbed`, and `sourceMapRoot` options because `sass-loader` sets these automatically when the `sourceMap` option is `true`.
> ℹ We strongly discourage changing the `sourceMap` (new API, by default since 16 version), `outFile` (old API), `sourceMapContents` (old API), `sourceMapEmbed` (old API), and `sourceMapRoot` (old API) options because `sass-loader` sets these automatically when the `sourceMap` option is `true`.
> [!NOTE]
>
Expand All @@ -313,7 +313,9 @@ There is a slight difference between the options for `sass` (`dart-sass`) and `n
Please consult their respective documentation before using them:

- [Dart Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/Options) for all available `sass` options.
- [Sass Embedded documentation](https://github.com/sass/embedded-host-node) for all available `sass` options.
- [Node Sass documentation](https://github.com/sass/node-sass/#options) for all available `node-sass` options.
- [Sass Embedded documentation](https://github.com/sass/embedded-host-node) for all available `sass` options.

#### `object`

Expand All @@ -334,8 +336,8 @@ module.exports = {
loader: "sass-loader",
options: {
sassOptions: {
indentWidth: 4,
includePaths: ["absolute/path/a", "absolute/path/b"],
style: `compressed`,
loadPaths: ["absolute/path/a", "absolute/path/b"],
},
},
},
Expand Down Expand Up @@ -369,12 +371,12 @@ module.exports = {

if (relativePath === "styles/foo.scss") {
return {
includePaths: ["absolute/path/c", "absolute/path/d"],
loadPaths: ["absolute/path/c", "absolute/path/d"],
};
}

return {
includePaths: ["absolute/path/a", "absolute/path/b"],
loadPaths: ["absolute/path/a", "absolute/path/b"],
};
},
},
Expand All @@ -401,7 +403,7 @@ Enables/Disables generation of source maps.
By default generation of source maps depends on the [`devtool`](https://webpack.js.org/configuration/devtool/) option.
All values enable source map generation except `eval` and `false`.

> ℹ If `true`, the `sourceMap`, `sourceMapRoot`, `sourceMapEmbed`, `sourceMapContents` and `omitSourceMapUrl` options from `sassOptions` will be ignored.
> ℹ If `true`, the `sourceMap` (new API, by default since 16 version), `outFile` (old API), `sourceMapContents` (old API), `sourceMapEmbed` (old API), and `sourceMapRoot` (old API) from `sassOptions` will be ignored.
**webpack.config.js**

Expand Down Expand Up @@ -683,7 +685,7 @@ Type:
type api = "legacy" | "modern" | "modern-compiler";
```

Default: `"modern"` for `sass` (`dart-sass`) and `sass-embedded` or `"legacy"` for `node-sass`
Default: `"modern"` for `sass` (`dart-sass`) and `sass-embedded`, or `"legacy"` for `node-sass`

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

Expand Down

0 comments on commit eda8505

Please sign in to comment.