Skip to content

Commit eda8505

Browse files
docs: update (#1242)
1 parent a874a36 commit eda8505

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ module.exports = {
9898

9999
Finally run `webpack` via your preferred method.
100100

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

103-
For `production` mode, the `outputStyle` (old API) and `style` (new API) options default to `compressed` unless otherwise specified in `sassOptions`.
103+
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`.
104104

105-
### Resolving `import` at-rules
105+
### Resolving `import` and `use` at-rules
106106

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

@@ -296,13 +296,13 @@ Options for [Dart Sass](http://sass-lang.com/dart-sass) or [Node Sass](https://g
296296
297297
> [!NOTE]
298298
>
299-
> The `indentedSyntax` option is `true` for the `sass` extension.
299+
> 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.
300300
301301
> [!NOTE]
302302
>
303303
> Options such as `data` and `file` are unavailable and will be ignored.
304304
305-
> ℹ We strongly discourage changing the `outFile`, `sourceMapContents`, `sourceMapEmbed`, and `sourceMapRoot` options because `sass-loader` sets these automatically when the `sourceMap` option is `true`.
305+
> ℹ 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`.
306306
307307
> [!NOTE]
308308
>
@@ -313,7 +313,9 @@ There is a slight difference between the options for `sass` (`dart-sass`) and `n
313313
Please consult their respective documentation before using them:
314314

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

318320
#### `object`
319321

@@ -334,8 +336,8 @@ module.exports = {
334336
loader: "sass-loader",
335337
options: {
336338
sassOptions: {
337-
indentWidth: 4,
338-
includePaths: ["absolute/path/a", "absolute/path/b"],
339+
style: `compressed`,
340+
loadPaths: ["absolute/path/a", "absolute/path/b"],
339341
},
340342
},
341343
},
@@ -369,12 +371,12 @@ module.exports = {
369371

370372
if (relativePath === "styles/foo.scss") {
371373
return {
372-
includePaths: ["absolute/path/c", "absolute/path/d"],
374+
loadPaths: ["absolute/path/c", "absolute/path/d"],
373375
};
374376
}
375377

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

404-
> ℹ If `true`, the `sourceMap`, `sourceMapRoot`, `sourceMapEmbed`, `sourceMapContents` and `omitSourceMapUrl` options from `sassOptions` will be ignored.
406+
> ℹ 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.
405407
406408
**webpack.config.js**
407409

@@ -683,7 +685,7 @@ Type:
683685
type api = "legacy" | "modern" | "modern-compiler";
684686
```
685687

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

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

0 commit comments

Comments
 (0)