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
> To enable CSS processing in your project, you need to install [style-loader](https://webpack.js.org/loaders/style-loader/) and [css-loader](https://webpack.js.org/loaders/css-loader/) via `npm i style-loader css-loader`.
45
45
46
-
`sass-loader` requires you to install either [Dart Sass](https://github.com/sass/dart-sass), [Node Sass](https://github.com/sass/node-sass) on your own (more documentation can be found below) or [Sass Embedded](https://github.com/sass/embedded-host-node).
46
+
`sass-loader` requires you to install either [Dart Sass](https://github.com/sass/dart-sass) or [Sass Embedded](https://github.com/sass/embedded-host-node) on your own (more documentation can be found below).
47
47
48
48
This allows you to control the versions of all your dependencies and to choose which Sass implementation to use.
49
49
50
50
> [!NOTE]
51
51
>
52
52
> We highly recommend using [Sass Embedded](https://github.com/sass/embedded-host-node) or [Dart Sass](https://github.com/sass/dart-sass).
53
53
54
-
> [!WARNING]
55
-
>
56
-
> [Node Sass](https://github.com/sass/node-sass) does not work with [Yarn PnP](https://classic.yarnpkg.com/en/docs/pnp/) and doesn't support [@use rule](https://sass-lang.com/documentation/at-rules/use).
57
-
58
54
Chain the `sass-loader` with the [css-loader](https://github.com/webpack/css-loader) and the [style-loader](https://github.com/webpack/style-loader) to immediately apply all styles to the DOM, or with the [mini-css-extract-plugin](https://github.com/webpack/mini-css-extract-plugin) to extract it into a separate file.
59
55
60
56
Then add the loader to your webpack configuration. For example:
@@ -167,7 +163,7 @@ Default: `sass`
167
163
The special `implementation` option determines which implementation of Sass to use.
168
164
169
165
By default, the loader resolves the implementation based on your dependencies.
170
-
Just add the desired implementation to your `package.json` (`sass`, `sass-embedded`, or `node-sass` package) and install dependencies.
166
+
Just add the desired implementation to your `package.json` (`sass`or `sass-embedded` package) and install dependencies.
171
167
172
168
Example where the `sass-loader` uses the `sass` (`dart-sass`) implementation:
173
169
@@ -182,19 +178,6 @@ Example where the `sass-loader` uses the `sass` (`dart-sass`) implementation:
182
178
}
183
179
```
184
180
185
-
Example where the `sass-loader` uses the `node-sass` implementation:
186
-
187
-
**package.json**
188
-
189
-
```json
190
-
{
191
-
"devDependencies": {
192
-
"sass-loader": "^7.2.0",
193
-
"node-sass": "^5.0.0"
194
-
}
195
-
}
196
-
```
197
-
198
181
Example where the `sass-loader` uses the `sass-embedded` implementation:
199
182
200
183
**package.json**
@@ -219,7 +202,6 @@ Be aware of the order that `sass-loader` will resolve the implementation:
219
202
220
203
1.`sass-embedded`
221
204
2.`sass`
222
-
3.`node-sass`
223
205
224
206
You can specify a specific implementation by using the `implementation` option, which accepts one of the above values.
225
207
@@ -293,7 +275,7 @@ type sassOptions =
293
275
294
276
Default: defaults values for Sass implementation
295
277
296
-
Options for [Dart Sass](http://sass-lang.com/dart-sass) or [Node Sass](https://github.com/sass/node-sass) implementation.
278
+
Options for [Dart Sass](http://sass-lang.com/dart-sass) or [Sass Embedded](https://github.com/sass/embedded-host-node) implementation.
297
279
298
280
> [!NOTE]
299
281
>
@@ -313,13 +295,10 @@ Options for [Dart Sass](http://sass-lang.com/dart-sass) or [Node Sass](https://g
313
295
>
314
296
> Access to the [loader context](https://webpack.js.org/api/loaders/#the-loader-context) inside the custom importer can be done using the `this.webpackLoaderContext` property.
315
297
316
-
There is a slight difference between the options for `sass` (`dart-sass`) and `node-sass`.
317
-
318
298
Please consult their respective documentation before using them:
319
299
320
300
-[Dart Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/Options) for all available `sass` options.
321
-
-[Sass Embedded documentation](https://github.com/sass/embedded-host-node) for all available `sass` options.
322
-
-[Node Sass documentation](https://github.com/sass/node-sass/#options) for all available `node-sass` options.
301
+
-[Sass Embedded documentation](https://github.com/sass/embedded-host-node) for all available `sass-embedded` options.
323
302
324
303
#### `object`
325
304
@@ -438,10 +417,6 @@ module.exports = {
438
417
};
439
418
```
440
419
441
-
> ℹ In some rare cases `node-sass` can output invalid source maps (this is a `node-sass` bug).
442
-
>
443
-
> In order to avoid this, you can try to update `node-sass` to the latest version, or you can try to set within `sassOptions` the `outputStyle` option to `compressed`.
444
-
445
420
**webpack.config.js**
446
421
447
422
```js
@@ -593,7 +568,7 @@ Default: `true`
593
568
Enables/disables the default webpack importer.
594
569
595
570
This can improve performance in some cases, though use it with caution because aliases and `@import` at-rules starting with `~` will not work.
596
-
You can pass your own `importer` to solve this (see [`importer` docs](https://github.com/sass/node-sass#importer--v200---experimental)).
571
+
You can pass your own `importer` to solve this (see [Sass importer documentation](https://sass-lang.com/documentation/js-api/interfaces/LegacyImporter)).
597
572
598
573
**webpack.config.js**
599
574
@@ -689,7 +664,7 @@ Type:
689
664
typeapi="legacy"|"modern"|"modern-compiler";
690
665
```
691
666
692
-
Default: `"modern"` for `sass` (`dart-sass`) and `sass-embedded`, or `"legacy"` for `node-sass`
667
+
Default: `"modern"` for `sass` (`dart-sass`) and `sass-embedded`
693
668
694
669
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).
0 commit comments