sass-loader 9.0.1 → 9.0.2
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/CHANGELOG.md +7 -0
- package/README.md +3 -3
- package/dist/index.js +1 -1
- package/dist/utils.js +11 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [9.0.2](https://github.com/webpack-contrib/sass-loader/compare/v9.0.1...v9.0.2) (2020-07-07)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* resolution algorithm for `node-sass` ([#866](https://github.com/webpack-contrib/sass-loader/issues/866)) ([4584c90](https://github.com/webpack-contrib/sass-loader/commit/4584c9054befbc56661e2781a55df96fb9f94673))
|
|
11
|
+
|
|
5
12
|
### [9.0.1](https://github.com/webpack-contrib/sass-loader/compare/v9.0.0...v9.0.1) (2020-07-03)
|
|
6
13
|
|
|
7
14
|
|
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ To begin, you'll need to install `sass-loader`:
|
|
|
27
27
|
npm install sass-loader sass webpack --save-dev
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
`sass-loader` requires you to install either [Dart Sass](https://github.com/sass/dart-sass)
|
|
30
|
+
`sass-loader` requires you to install either [Dart Sass](https://github.com/sass/dart-sass) or [Node Sass](https://github.com/sass/node-sass) on your own (more documentation can be found below).
|
|
31
31
|
|
|
32
32
|
This allows you to control the versions of all your dependencies, and to choose which Sass implementation to use.
|
|
33
33
|
|
|
@@ -628,5 +628,5 @@ Please take a moment to read our contributing guidelines if you haven't yet done
|
|
|
628
628
|
[cover-url]: https://codecov.io/gh/webpack-contrib/sass-loader
|
|
629
629
|
[chat]: https://badges.gitter.im/webpack/webpack.svg
|
|
630
630
|
[chat-url]: https://gitter.im/webpack/webpack
|
|
631
|
-
[size]: https://packagephobia.now.sh/badge?p=
|
|
632
|
-
[size-url]: https://packagephobia.now.sh/result?p=
|
|
631
|
+
[size]: https://packagephobia.now.sh/badge?p=sass-loader
|
|
632
|
+
[size-url]: https://packagephobia.now.sh/result?p=sass-loader
|
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ function loader(content) {
|
|
|
39
39
|
const {
|
|
40
40
|
includePaths
|
|
41
41
|
} = sassOptions;
|
|
42
|
-
sassOptions.importer.push((0, _utils.getWebpackImporter)(this, includePaths));
|
|
42
|
+
sassOptions.importer.push((0, _utils.getWebpackImporter)(this, implementation, includePaths));
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
const callback = this.async();
|
package/dist/utils.js
CHANGED
|
@@ -237,7 +237,7 @@ const isSpecialModuleImport = /^~[^/]+$/; // `[drive_letter]:\` + `\\[server]\[s
|
|
|
237
237
|
|
|
238
238
|
const isNativeWin32Path = /^[a-zA-Z]:[/\\]|^\\\\/i;
|
|
239
239
|
|
|
240
|
-
function getWebpackImporter(loaderContext, includePaths) {
|
|
240
|
+
function getWebpackImporter(loaderContext, implementation, includePaths) {
|
|
241
241
|
function startResolving(resolutionMap) {
|
|
242
242
|
if (resolutionMap.length === 0) {
|
|
243
243
|
return Promise.reject();
|
|
@@ -322,6 +322,16 @@ function getWebpackImporter(loaderContext, includePaths) {
|
|
|
322
322
|
//
|
|
323
323
|
// Because `sass`/`node-sass` run custom importers before `3`, `4` and `5` points, we need to emulate this behavior to avoid wrong resolution.
|
|
324
324
|
const sassPossibleRequests = getPossibleRequests(loaderContext, request);
|
|
325
|
+
const isDartSass = implementation.info.includes('dart-sass'); // `node-sass` calls our importer before `1. Filesystem imports relative to the base file.`, so we need emulate this too
|
|
326
|
+
|
|
327
|
+
if (!isDartSass) {
|
|
328
|
+
resolutionMap = resolutionMap.concat({
|
|
329
|
+
resolve: sassResolve,
|
|
330
|
+
context: _path.default.dirname(prev),
|
|
331
|
+
possibleRequests: sassPossibleRequests
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
|
|
325
335
|
resolutionMap = resolutionMap.concat(includePaths.map(context => ({
|
|
326
336
|
resolve: sassResolve,
|
|
327
337
|
context,
|