Skip to content

Commit 189196a

Browse files
authored
docs: add note about css and style loader (#1206)
1 parent dfcd3cc commit 189196a

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,23 @@ or
3838
pnpm add -D sass-loader sass webpack
3939
```
4040

41+
> [!NOTE]
42+
>
43+
> 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`.
44+
4145
`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).
4246

4347
This allows you to control the versions of all your dependencies, and to choose which Sass implementation to use.
4448

45-
> **Note**
49+
> [!NOTE]
4650
>
4751
> We highly recommend using [Dart Sass](https://github.com/sass/dart-sass).
4852
49-
> **Warning**
53+
> [!WARNING]
5054
>
5155
> [Node Sass](https://github.com/sass/node-sass) does not work with [Yarn PnP](https://classic.yarnpkg.com/en/docs/pnp/) feature and doesn't support [@use rule](https://sass-lang.com/documentation/at-rules/use).
5256
53-
> **Warning**
57+
> [!WARNING]
5458
>
5559
> [Sass Embedded](https://github.com/sass/embedded-host-node) is experimental and in `beta`, therefore some features may not work
5660
@@ -267,21 +271,21 @@ Default: defaults values for Sass implementation
267271

268272
Options for [Dart Sass](http://sass-lang.com/dart-sass) or [Node Sass](https://github.com/sass/node-sass) implementation.
269273

270-
> **Note**
274+
> [!NOTE]
271275
>
272276
> The `charset` option has `true` value by default for `dart-sass`, we strongly discourage change value to `false`, because webpack doesn't support files other than `utf-8`.
273277
274-
> **Note**
278+
> [!NOTE]
275279
>
276280
> The `indentedSyntax` option has `true` value for the `sass` extension.
277281
278-
> **Note**
282+
> [!NOTE]
279283
>
280284
> Options such as `data` and `file` are unavailable and will be ignored.
281285
282286
> ℹ We strongly discourage change `outFile`, `sourceMapContents`, `sourceMapEmbed`, `sourceMapRoot` options because `sass-loader` automatically sets these options when the `sourceMap` option is `true`.
283287
284-
> **Note**
288+
> [!NOTE]
285289
>
286290
> 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.
287291
@@ -664,11 +668,11 @@ Default: `"legacy"`
664668

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

667-
> **Note**
671+
> [!NOTE]
668672
>
669673
> 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.
670674
671-
> **Warning**
675+
> [!WARNING]
672676
>
673677
> The sass options are different for `modern` and `old` APIs. Please look at [docs](https://sass-lang.com/documentation/js-api) how to migrate on new options.
674678

0 commit comments

Comments
 (0)