sass-loader 10.1.0 → 10.1.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 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
+ ### [10.1.1](https://github.com/webpack-contrib/sass-loader/compare/v10.1.0...v10.1.1) (2021-01-11)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * problem with resolving and the `includePaths` option ([#913](https://github.com/webpack-contrib/sass-loader/issues/913)) ([cadc75e](https://github.com/webpack-contrib/sass-loader/commit/cadc75e80caf7d32ea47de1cbaab639f9204c0eb))
11
+
5
12
  ## [10.1.0](https://github.com/webpack-contrib/sass-loader/compare/v10.0.5...v10.1.0) (2020-11-11)
6
13
 
7
14
 
package/dist/index.js CHANGED
@@ -70,7 +70,12 @@ async function loader(content) {
70
70
  }
71
71
 
72
72
  result.stats.includedFiles.forEach(includedFile => {
73
- this.addDependency(_path.default.normalize(includedFile));
73
+ const normalizedIncludedFile = _path.default.normalize(includedFile); // Custom `importer` can return only `contents` so includedFile will be relative
74
+
75
+
76
+ if (_path.default.isAbsolute(normalizedIncludedFile)) {
77
+ this.addDependency(normalizedIncludedFile);
78
+ }
74
79
  });
75
80
  callback(null, result.css.toString(), map);
76
81
  });
package/dist/utils.js CHANGED
@@ -103,11 +103,9 @@ function isProductionLikeMode(loaderContext) {
103
103
  }
104
104
 
105
105
  function proxyCustomImporters(importers, loaderContext) {
106
- return [].concat(importers).map(importer => {
107
- return function proxyImporter(...args) {
108
- this.webpackLoaderContext = loaderContext;
109
- return importer.apply(this, args);
110
- };
106
+ return [].concat(importers).map(importer => function proxyImporter(...args) {
107
+ this.webpackLoaderContext = loaderContext;
108
+ return importer.apply(this, args);
111
109
  });
112
110
  }
113
111
  /**
@@ -186,7 +184,8 @@ async function getSassOptions(loaderContext, loaderOptions, content, implementat
186
184
 
187
185
 
188
186
  options.importer = options.importer ? proxyCustomImporters(Array.isArray(options.importer) ? options.importer : [options.importer], loaderContext) : [];
189
- options.includePaths = [].concat(process.cwd()).concat(options.includePaths || []).concat(process.env.SASS_PATH ? process.env.SASS_PATH.split(process.platform === "win32" ? ";" : ":") : []);
187
+ options.includePaths = [].concat(process.cwd()).concat( // We use `includePaths` in context for resolver, so it should be always absolute
188
+ (options.includePaths || []).map(includePath => _path.default.isAbsolute(includePath) ? includePath : _path.default.join(process.cwd(), includePath))).concat(process.env.SASS_PATH ? process.env.SASS_PATH.split(process.platform === "win32" ? ";" : ":") : []);
190
189
  return options;
191
190
  } // Examples:
192
191
  // - ~package
@@ -377,11 +376,13 @@ function getWebpackResolver(resolverFactory, implementation, includePaths = [],
377
376
  }
378
377
 
379
378
  resolutionMap = resolutionMap.concat( // eslint-disable-next-line no-shadow
380
- includePaths.map(context => ({
381
- resolve: sassResolve,
382
- context,
383
- possibleRequests: sassPossibleRequests
384
- })));
379
+ includePaths.map(context => {
380
+ return {
381
+ resolve: sassResolve,
382
+ context,
383
+ possibleRequests: sassPossibleRequests
384
+ };
385
+ }));
385
386
  }
386
387
 
387
388
  const webpackPossibleRequests = getPossibleRequests(request, true, rootContext);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sass-loader",
3
- "version": "10.1.0",
3
+ "version": "10.1.1",
4
4
  "description": "Sass loader for webpack",
5
5
  "license": "MIT",
6
6
  "repository": "webpack-contrib/sass-loader",
@@ -77,9 +77,9 @@
77
77
  "css-loader": "^5.0.1",
78
78
  "del": "^6.0.0",
79
79
  "del-cli": "^3.0.1",
80
- "enhanced-resolve": "^5.3.1",
80
+ "enhanced-resolve": "^5.5.0",
81
81
  "eslint": "^7.13.0",
82
- "eslint-config-prettier": "^6.15.0",
82
+ "eslint-config-prettier": "^7.1.0",
83
83
  "eslint-plugin-import": "^2.22.1",
84
84
  "fibers": "^5.0.0",
85
85
  "file-loader": "^6.2.0",
@@ -95,7 +95,7 @@
95
95
  "sass": "^1.29.0",
96
96
  "standard-version": "^9.0.0",
97
97
  "style-loader": "^2.0.0",
98
- "webpack": "^5.4.0"
98
+ "webpack": "^5.12.2"
99
99
  },
100
100
  "keywords": [
101
101
  "sass",