sass-loader 7.0.0 → 7.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/CHANGELOG.md +11 -0
- package/lib/importsToResolve.js +7 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
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
|
+
<a name="7.0.1"></a>
|
|
6
|
+
## [7.0.1](https://github.com/webpack-contrib/sass-loader/compare/v7.0.0...v7.0.1) (2018-04-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Wrong import precedence (#557) ([f4eeff1](https://github.com/webpack-contrib/sass-loader/commit/f4eeff1))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
5
15
|
<a name="7.0.0"></a>
|
|
6
16
|
# [7.0.0](https://github.com/webpack-contrib/sass-loader/compare/v6.0.7...v7.0.0) (2018-04-13)
|
|
7
17
|
|
|
@@ -14,6 +24,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
14
24
|
|
|
15
25
|
### BREAKING CHANGES
|
|
16
26
|
|
|
27
|
+
* Drop official node 4 support
|
|
17
28
|
* This slightly changes the resolving algorithm. Should not break in normal usage, but might break in complex configurations.
|
|
18
29
|
* The sass-loader throws an error at runtime now and refuses to compile if the peer dependency is wrong. This could break applications where npm's peer dependency warning was just ignored.
|
|
19
30
|
|
package/lib/importsToResolve.js
CHANGED
|
@@ -8,7 +8,7 @@ const matchModuleImport = /^~([^\/]+|@[^\/]+[\/][^\/]+)$/g;
|
|
|
8
8
|
/**
|
|
9
9
|
* When libsass tries to resolve an import, it uses a special algorithm.
|
|
10
10
|
* Since the sass-loader uses webpack to resolve the modules, we need to simulate that algorithm. This function
|
|
11
|
-
* returns an array of import paths to try. The
|
|
11
|
+
* returns an array of import paths to try. The last entry in the array is always the original url
|
|
12
12
|
* to enable straight-forward webpack.config aliases.
|
|
13
13
|
*
|
|
14
14
|
* @param {string} url
|
|
@@ -21,7 +21,7 @@ function importsToResolve(url) {
|
|
|
21
21
|
const ext = path.extname(request);
|
|
22
22
|
|
|
23
23
|
if (matchModuleImport.test(url)) {
|
|
24
|
-
return [
|
|
24
|
+
return [request, url];
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
// libsass' import algorithm works like this:
|
|
@@ -33,7 +33,7 @@ function importsToResolve(url) {
|
|
|
33
33
|
return [];
|
|
34
34
|
}
|
|
35
35
|
if (ext === ".scss" || ext === ".sass") {
|
|
36
|
-
return [
|
|
36
|
+
return [request, url];
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// In case there is no file extension...
|
|
@@ -43,17 +43,17 @@ function importsToResolve(url) {
|
|
|
43
43
|
|
|
44
44
|
if (basename.charAt(0) === "_") {
|
|
45
45
|
return [
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
`${ request }.scss`, `${ request }.sass`, `${ request }.css`,
|
|
47
|
+
url
|
|
48
48
|
];
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
const dirname = path.dirname(request);
|
|
52
52
|
|
|
53
53
|
return [
|
|
54
|
-
url,
|
|
55
54
|
`${ dirname }/_${ basename }.scss`, `${ dirname }/_${ basename }.sass`, `${ dirname }/_${ basename }.css`,
|
|
56
|
-
`${ request }.scss`, `${ request }.sass`, `${ request }.css
|
|
55
|
+
`${ request }.scss`, `${ request }.sass`, `${ request }.css`,
|
|
56
|
+
url
|
|
57
57
|
];
|
|
58
58
|
}
|
|
59
59
|
|