sass-loader 9.0.2 → 9.0.3

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/utils.js +18 -14
  3. package/package.json +16 -16
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.3](https://github.com/webpack-contrib/sass-loader/compare/v9.0.2...v9.0.3) (2020-08-05)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * resolution algorithm ([#875](https://github.com/webpack-contrib/sass-loader/issues/875)) ([ea73cfa](https://github.com/webpack-contrib/sass-loader/commit/ea73cfab047c751e1055d0c2ec58ef503f7dbe36))
11
+
5
12
  ### [9.0.2](https://github.com/webpack-contrib/sass-loader/compare/v9.0.1...v9.0.2) (2020-07-07)
6
13
 
7
14
 
package/dist/utils.js CHANGED
@@ -229,7 +229,7 @@ url, forWebpackResolver = false) {
229
229
 
230
230
  const basename = _path.default.basename(request);
231
231
 
232
- return [...new Set([`${dirname}/_${basename}`, request].concat(forWebpackResolver ? [url] : []))];
232
+ return [...new Set([`${dirname}/_${basename}`, request].concat(forWebpackResolver ? [`${_path.default.dirname(url)}/_${basename}`, url] : []))];
233
233
  }
234
234
 
235
235
  const matchCss = /\.css$/i;
@@ -238,7 +238,7 @@ const isSpecialModuleImport = /^~[^/]+$/; // `[drive_letter]:\` + `\\[server]\[s
238
238
  const isNativeWin32Path = /^[a-zA-Z]:[/\\]|^\\\\/i;
239
239
 
240
240
  function getWebpackImporter(loaderContext, implementation, includePaths) {
241
- function startResolving(resolutionMap) {
241
+ async function startResolving(resolutionMap) {
242
242
  if (resolutionMap.length === 0) {
243
243
  return Promise.reject();
244
244
  }
@@ -248,16 +248,11 @@ function getWebpackImporter(loaderContext, implementation, includePaths) {
248
248
  context,
249
249
  possibleRequests
250
250
  }] = resolutionMap;
251
- return resolve(context, possibleRequests[0]).then(result => {
252
- // Add the result as dependency.
253
- // Although we're also using stats.includedFiles, this might come in handy when an error occurs.
254
- // In this case, we don't get stats.includedFiles from node-sass/sass.
255
- loaderContext.addDependency(_path.default.normalize(result)); // By removing the CSS file extension, we trigger node-sass to include the CSS file instead of just linking it.
256
-
257
- return {
258
- file: result.replace(matchCss, '')
259
- };
260
- }).catch(() => {
251
+ let result;
252
+
253
+ try {
254
+ result = await resolve(context, possibleRequests[0]);
255
+ } catch (_ignoreError) {
261
256
  const [, ...tailResult] = possibleRequests;
262
257
 
263
258
  if (tailResult.length === 0) {
@@ -268,7 +263,16 @@ function getWebpackImporter(loaderContext, implementation, includePaths) {
268
263
 
269
264
  resolutionMap[0].possibleRequests = tailResult;
270
265
  return startResolving(resolutionMap);
271
- });
266
+ } // Add the result as dependency.
267
+ // Although we're also using stats.includedFiles, this might come in handy when an error occurs.
268
+ // In this case, we don't get stats.includedFiles from node-sass/sass.
269
+
270
+
271
+ loaderContext.addDependency(_path.default.normalize(result)); // By removing the CSS file extension, we trigger node-sass to include the CSS file instead of just linking it.
272
+
273
+ return {
274
+ file: result.replace(matchCss, '')
275
+ };
272
276
  }
273
277
 
274
278
  const sassResolve = loaderContext.getResolve({
@@ -348,7 +352,7 @@ function getWebpackImporter(loaderContext, implementation, includePaths) {
348
352
  startResolving(resolutionMap) // Catch all resolving errors, return the original file and pass responsibility back to other custom importers
349
353
  .catch(() => ({
350
354
  file: originalUrl
351
- })).then(done);
355
+ })).then(result => done(result));
352
356
  };
353
357
  }
354
358
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sass-loader",
3
- "version": "9.0.2",
3
+ "version": "9.0.3",
4
4
  "description": "Sass loader for webpack",
5
5
  "license": "MIT",
6
6
  "repository": "webpack-contrib/sass-loader",
@@ -56,45 +56,45 @@
56
56
  }
57
57
  },
58
58
  "dependencies": {
59
- "klona": "^1.1.1",
59
+ "klona": "^1.1.2",
60
60
  "loader-utils": "^2.0.0",
61
- "neo-async": "^2.6.1",
61
+ "neo-async": "^2.6.2",
62
62
  "schema-utils": "^2.7.0",
63
63
  "semver": "^7.3.2"
64
64
  },
65
65
  "devDependencies": {
66
- "@babel/cli": "^7.10.3",
67
- "@babel/core": "^7.10.3",
68
- "@babel/preset-env": "^7.10.3",
69
- "@commitlint/cli": "^9.0.1",
70
- "@commitlint/config-conventional": "^9.0.1",
66
+ "@babel/cli": "^7.10.5",
67
+ "@babel/core": "^7.11.0",
68
+ "@babel/preset-env": "^7.11.0",
69
+ "@commitlint/cli": "^9.1.1",
70
+ "@commitlint/config-conventional": "^9.1.1",
71
71
  "@webpack-contrib/defaults": "^6.3.0",
72
72
  "@webpack-contrib/eslint-config-webpack": "^3.0.0",
73
- "babel-jest": "^26.0.1",
74
- "bootstrap": "^4.5.0",
73
+ "babel-jest": "^26.2.2",
74
+ "bootstrap": "^4.5.1",
75
75
  "bootstrap-sass": "^3.4.1",
76
76
  "cross-env": "^7.0.2",
77
- "css-loader": "^3.6.0",
77
+ "css-loader": "^4.2.0",
78
78
  "del": "^5.1.0",
79
79
  "del-cli": "^3.0.1",
80
- "eslint": "^7.3.0",
80
+ "eslint": "^7.6.0",
81
81
  "eslint-config-prettier": "^6.11.0",
82
82
  "eslint-plugin-import": "^2.21.2",
83
83
  "fibers": "^5.0.0",
84
84
  "file-loader": "^6.0.0",
85
85
  "foundation-sites": "^6.6.3",
86
86
  "husky": "^4.2.5",
87
- "jest": "^26.0.1",
87
+ "jest": "^26.2.2",
88
88
  "lint-staged": "^10.2.11",
89
89
  "material-components-web": "^7.0.0",
90
90
  "memfs": "^3.2.0",
91
91
  "node-sass": "^4.14.1",
92
92
  "npm-run-all": "^4.1.5",
93
93
  "prettier": "^2.0.5",
94
- "sass": "^1.26.8",
95
- "standard-version": "^8.0.0",
94
+ "sass": "^1.26.10",
95
+ "standard-version": "^8.0.2",
96
96
  "style-loader": "^1.2.1",
97
- "webpack": "^4.43.0"
97
+ "webpack": "^4.44.1"
98
98
  },
99
99
  "keywords": [
100
100
  "sass",