css-loader 6.8.0 → 6.8.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.
Files changed (2) hide show
  1. package/dist/utils.js +26 -22
  2. package/package.json +1 -1
package/dist/utils.js CHANGED
@@ -1009,37 +1009,41 @@ function combineRequests(preRequest, url) {
1009
1009
  const idx = url.indexOf("!=!");
1010
1010
  return idx !== -1 ? url.slice(0, idx + 3) + preRequest + url.slice(idx + 3) : preRequest + url;
1011
1011
  }
1012
- function warningFactory(obj) {
1012
+ function warningFactory(warning) {
1013
1013
  let message = "";
1014
- if (typeof obj.line !== "undefined") {
1015
- message += `(${obj.line}:${obj.column}) `;
1014
+ if (typeof warning.line !== "undefined") {
1015
+ message += `(${warning.line}:${warning.column}) `;
1016
1016
  }
1017
- if (typeof obj.plugin !== "undefined") {
1018
- message += `from "${obj.plugin}" plugin: `;
1017
+ if (typeof warning.plugin !== "undefined") {
1018
+ message += `from "${warning.plugin}" plugin: `;
1019
1019
  }
1020
- message += obj.text;
1021
- if (obj.node) {
1022
- message += `\n\nCode:\n ${obj.node.toString()}\n`;
1020
+ message += warning.text;
1021
+ if (warning.node) {
1022
+ message += `\n\nCode:\n ${warning.node.toString()}\n`;
1023
1023
  }
1024
- const warning = new Error(message);
1025
- warning.stack = null;
1026
- return warning;
1024
+ const obj = new Error(message, {
1025
+ cause: warning
1026
+ });
1027
+ obj.stack = null;
1028
+ return obj;
1027
1029
  }
1028
- function syntaxErrorFactory(obj) {
1030
+ function syntaxErrorFactory(error) {
1029
1031
  let message = "\nSyntaxError\n\n";
1030
- if (typeof obj.line !== "undefined") {
1031
- message += `(${obj.line}:${obj.column}) `;
1032
+ if (typeof error.line !== "undefined") {
1033
+ message += `(${error.line}:${error.column}) `;
1032
1034
  }
1033
- if (typeof obj.plugin !== "undefined") {
1034
- message += `from "${obj.plugin}" plugin: `;
1035
+ if (typeof error.plugin !== "undefined") {
1036
+ message += `from "${error.plugin}" plugin: `;
1035
1037
  }
1036
- message += obj.file ? `${obj.file} ` : "<css input> ";
1037
- message += `${obj.reason}`;
1038
- const code = obj.showSourceCode();
1038
+ message += error.file ? `${error.file} ` : "<css input> ";
1039
+ message += `${error.reason}`;
1040
+ const code = error.showSourceCode();
1039
1041
  if (code) {
1040
1042
  message += `\n\n${code}\n`;
1041
1043
  }
1042
- const error = new Error(message);
1043
- error.stack = null;
1044
- return error;
1044
+ const obj = new Error(message, {
1045
+ cause: error
1046
+ });
1047
+ obj.stack = null;
1048
+ return obj;
1045
1049
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "css-loader",
3
- "version": "6.8.0",
3
+ "version": "6.8.1",
4
4
  "description": "css loader module for webpack",
5
5
  "license": "MIT",
6
6
  "repository": "webpack-contrib/css-loader",