sass-loader 13.0.0 → 13.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -14
- package/dist/utils.js +3 -1
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
[![npm][npm]][npm-url]
|
|
11
11
|
[![node][node]][node-url]
|
|
12
|
-
[![deps][deps]][deps-url]
|
|
13
12
|
[![tests][tests]][tests-url]
|
|
14
13
|
[![coverage][cover]][cover-url]
|
|
15
14
|
[![chat][chat]][chat-url]
|
|
@@ -43,11 +42,17 @@ pnpm add -D sass-loader sass webpack
|
|
|
43
42
|
|
|
44
43
|
This allows you to control the versions of all your dependencies, and to choose which Sass implementation to use.
|
|
45
44
|
|
|
46
|
-
>
|
|
45
|
+
> **Note**
|
|
46
|
+
>
|
|
47
|
+
> We highly recommend using [Dart Sass](https://github.com/sass/dart-sass).
|
|
47
48
|
|
|
48
|
-
>
|
|
49
|
+
> **Warning**
|
|
50
|
+
>
|
|
51
|
+
> [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).
|
|
49
52
|
|
|
50
|
-
>
|
|
53
|
+
> **Warning**
|
|
54
|
+
>
|
|
55
|
+
> [Sass Embedded](https://github.com/sass/embedded-host-node) is experimental and in `beta`, therefore some features may not work
|
|
51
56
|
|
|
52
57
|
Chain the `sass-loader` with the [css-loader](https://github.com/webpack-contrib/css-loader) and the [style-loader](https://github.com/webpack-contrib/style-loader) to immediately apply all styles to the DOM or the [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) to extract it into a separate file.
|
|
53
58
|
|
|
@@ -245,7 +250,9 @@ To avoid this overhead, you can use the [fibers](https://www.npmjs.com/package/f
|
|
|
245
250
|
|
|
246
251
|
We automatically inject the [`fibers`](https://github.com/laverdet/node-fibers) package (setup `sassOptions.fiber`) for `Node.js` less v16.0.0 if is possible (i.e. you need install the [`fibers`](https://github.com/laverdet/node-fibers) package).
|
|
247
252
|
|
|
248
|
-
>
|
|
253
|
+
> **Warning**
|
|
254
|
+
>
|
|
255
|
+
> Fibers is not compatible with `Node.js` v16.0.0 or later. Unfortunately, v8 commit [dacc2fee0f](https://github.com/v8/v8/commit/dacc2fee0f815823782a7e432c79c2a7767a4765) is a breaking change and workarounds are non-trivial. ([see introduction to readme](https://github.com/laverdet/node-fibers)).
|
|
249
256
|
|
|
250
257
|
**package.json**
|
|
251
258
|
|
|
@@ -335,15 +342,23 @@ Default: defaults values for Sass implementation
|
|
|
335
342
|
|
|
336
343
|
Options for [Dart Sass](http://sass-lang.com/dart-sass) or [Node Sass](https://github.com/sass/node-sass) implementation.
|
|
337
344
|
|
|
338
|
-
>
|
|
345
|
+
> **Note**
|
|
346
|
+
>
|
|
347
|
+
> 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`.
|
|
339
348
|
|
|
340
|
-
>
|
|
349
|
+
> **Note**
|
|
350
|
+
>
|
|
351
|
+
> The `indentedSyntax` option has `true` value for the `sass` extension.
|
|
341
352
|
|
|
342
|
-
>
|
|
353
|
+
> **Note**
|
|
354
|
+
>
|
|
355
|
+
> Options such as `data` and `file` are unavailable and will be ignored.
|
|
343
356
|
|
|
344
357
|
> ℹ We strongly discourage change `outFile`, `sourceMapContents`, `sourceMapEmbed`, `sourceMapRoot` options because `sass-loader` automatically sets these options when the `sourceMap` option is `true`.
|
|
345
358
|
|
|
346
|
-
>
|
|
359
|
+
> **Note**
|
|
360
|
+
>
|
|
361
|
+
> 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.
|
|
347
362
|
|
|
348
363
|
There is a slight difference between the `sass` (`dart-sass`) and `node-sass` options.
|
|
349
364
|
|
|
@@ -662,7 +677,9 @@ Default: `false`
|
|
|
662
677
|
|
|
663
678
|
Treats the `@warn` rule as a webpack warning.
|
|
664
679
|
|
|
665
|
-
>
|
|
680
|
+
> **Note**
|
|
681
|
+
>
|
|
682
|
+
> It will be `true` by default in the next major release.
|
|
666
683
|
|
|
667
684
|
**style.scss**
|
|
668
685
|
|
|
@@ -726,9 +743,13 @@ Default: `"legacy"`
|
|
|
726
743
|
|
|
727
744
|
Allows you to switch between `legacy` and `modern` API. You can find more information [here](https://sass-lang.com/documentation/js-api).
|
|
728
745
|
|
|
729
|
-
>
|
|
746
|
+
> **Warning**
|
|
747
|
+
>
|
|
748
|
+
> "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).
|
|
730
749
|
|
|
731
|
-
>
|
|
750
|
+
> **Warning**
|
|
751
|
+
>
|
|
752
|
+
> 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.
|
|
732
753
|
|
|
733
754
|
**webpack.config.js**
|
|
734
755
|
|
|
@@ -757,6 +778,20 @@ module.exports = {
|
|
|
757
778
|
};
|
|
758
779
|
```
|
|
759
780
|
|
|
781
|
+
## How to enable `@debug` output
|
|
782
|
+
|
|
783
|
+
Defaults, the output of `@debug` messages is disabled.
|
|
784
|
+
To enable it, add to **webpack.config.js** following:
|
|
785
|
+
|
|
786
|
+
```js
|
|
787
|
+
module.exports = {
|
|
788
|
+
stats: {
|
|
789
|
+
loggingDebug: ["sass-loader"],
|
|
790
|
+
},
|
|
791
|
+
// ...
|
|
792
|
+
};
|
|
793
|
+
```
|
|
794
|
+
|
|
760
795
|
## Examples
|
|
761
796
|
|
|
762
797
|
### Extracts CSS into separate files
|
|
@@ -852,8 +887,6 @@ Please take a moment to read our contributing guidelines if you haven't yet done
|
|
|
852
887
|
[npm-url]: https://npmjs.com/package/sass-loader
|
|
853
888
|
[node]: https://img.shields.io/node/v/sass-loader.svg
|
|
854
889
|
[node-url]: https://nodejs.org
|
|
855
|
-
[deps]: https://david-dm.org/webpack-contrib/sass-loader.svg
|
|
856
|
-
[deps-url]: https://david-dm.org/webpack-contrib/sass-loader
|
|
857
890
|
[tests]: https://github.com/webpack-contrib/sass-loader/workflows/sass-loader/badge.svg
|
|
858
891
|
[tests-url]: https://github.com/webpack-contrib/sass-loader/actions
|
|
859
892
|
[cover]: https://codecov.io/gh/webpack-contrib/sass-loader/branch/master/graph/badge.svg
|
package/dist/utils.js
CHANGED
|
@@ -154,12 +154,14 @@ async function getSassOptions(loaderContext, loaderOptions, content, implementat
|
|
|
154
154
|
|
|
155
155
|
const formatSpan = span => `${span.url || "-"}:${span.start.line}:${span.start.column}: `;
|
|
156
156
|
|
|
157
|
+
const formatDebugSpan = span => `[debug:${span.start.line}:${span.start.column}] `;
|
|
158
|
+
|
|
157
159
|
options.logger = {
|
|
158
160
|
debug(message, loggerOptions) {
|
|
159
161
|
let builtMessage = "";
|
|
160
162
|
|
|
161
163
|
if (loggerOptions.span) {
|
|
162
|
-
builtMessage =
|
|
164
|
+
builtMessage = formatDebugSpan(loggerOptions.span);
|
|
163
165
|
}
|
|
164
166
|
|
|
165
167
|
builtMessage += message;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sass-loader",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.1",
|
|
4
4
|
"description": "Sass loader for webpack",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "webpack-contrib/sass-loader",
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@babel/cli": "^7.17.10",
|
|
67
|
-
"@babel/core": "^7.
|
|
68
|
-
"@babel/preset-env": "^7.
|
|
69
|
-
"@commitlint/cli": "^17.0.
|
|
70
|
-
"@commitlint/config-conventional": "^17.0.
|
|
67
|
+
"@babel/core": "^7.18.2",
|
|
68
|
+
"@babel/preset-env": "^7.18.2",
|
|
69
|
+
"@commitlint/cli": "^17.0.2",
|
|
70
|
+
"@commitlint/config-conventional": "^17.0.2",
|
|
71
71
|
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
|
|
72
72
|
"babel-jest": "^28.1.0",
|
|
73
73
|
"bootstrap-sass": "^3.4.1",
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
"bootstrap-v5": "npm:bootstrap@^5.0.1",
|
|
76
76
|
"cross-env": "^7.0.3",
|
|
77
77
|
"css-loader": "^6.6.0",
|
|
78
|
-
"del": "^6.
|
|
78
|
+
"del": "^6.1.1",
|
|
79
79
|
"del-cli": "^4.0.1",
|
|
80
80
|
"enhanced-resolve": "^5.8.2",
|
|
81
|
-
"eslint": "^8.
|
|
81
|
+
"eslint": "^8.16.0",
|
|
82
82
|
"eslint-config-prettier": "^8.3.0",
|
|
83
83
|
"eslint-plugin-import": "^2.25.4",
|
|
84
84
|
"fibers": "^5.0.1",
|
|
@@ -87,19 +87,19 @@
|
|
|
87
87
|
"husky": "^8.0.1",
|
|
88
88
|
"jest": "^28.1.0",
|
|
89
89
|
"jest-environment-node-single-context": "^28.0.0",
|
|
90
|
-
"lint-staged": "^12.
|
|
90
|
+
"lint-staged": "^12.5.0",
|
|
91
91
|
"material-components-web": "^8.0.0",
|
|
92
|
-
"memfs": "^3.4.
|
|
92
|
+
"memfs": "^3.4.4",
|
|
93
93
|
"node-sass": "^7.0.1",
|
|
94
94
|
"node-sass-glob-importer": "^5.3.2",
|
|
95
95
|
"npm-run-all": "^4.1.5",
|
|
96
96
|
"prettier": "^2.3.2",
|
|
97
|
-
"sass": "^1.
|
|
98
|
-
"sass-embedded": "^1.
|
|
97
|
+
"sass": "^1.52.1",
|
|
98
|
+
"sass-embedded": "^1.52.1",
|
|
99
99
|
"semver": "^7.3.5",
|
|
100
100
|
"standard-version": "^9.3.1",
|
|
101
101
|
"style-loader": "^3.2.1",
|
|
102
|
-
"webpack": "^5.
|
|
102
|
+
"webpack": "^5.73.0"
|
|
103
103
|
},
|
|
104
104
|
"keywords": [
|
|
105
105
|
"sass",
|