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.
- package/dist/utils.js +26 -22
- 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(
|
|
1012
|
+
function warningFactory(warning) {
|
|
1013
1013
|
let message = "";
|
|
1014
|
-
if (typeof
|
|
1015
|
-
message += `(${
|
|
1014
|
+
if (typeof warning.line !== "undefined") {
|
|
1015
|
+
message += `(${warning.line}:${warning.column}) `;
|
|
1016
1016
|
}
|
|
1017
|
-
if (typeof
|
|
1018
|
-
message += `from "${
|
|
1017
|
+
if (typeof warning.plugin !== "undefined") {
|
|
1018
|
+
message += `from "${warning.plugin}" plugin: `;
|
|
1019
1019
|
}
|
|
1020
|
-
message +=
|
|
1021
|
-
if (
|
|
1022
|
-
message += `\n\nCode:\n ${
|
|
1020
|
+
message += warning.text;
|
|
1021
|
+
if (warning.node) {
|
|
1022
|
+
message += `\n\nCode:\n ${warning.node.toString()}\n`;
|
|
1023
1023
|
}
|
|
1024
|
-
const
|
|
1025
|
-
|
|
1026
|
-
|
|
1024
|
+
const obj = new Error(message, {
|
|
1025
|
+
cause: warning
|
|
1026
|
+
});
|
|
1027
|
+
obj.stack = null;
|
|
1028
|
+
return obj;
|
|
1027
1029
|
}
|
|
1028
|
-
function syntaxErrorFactory(
|
|
1030
|
+
function syntaxErrorFactory(error) {
|
|
1029
1031
|
let message = "\nSyntaxError\n\n";
|
|
1030
|
-
if (typeof
|
|
1031
|
-
message += `(${
|
|
1032
|
+
if (typeof error.line !== "undefined") {
|
|
1033
|
+
message += `(${error.line}:${error.column}) `;
|
|
1032
1034
|
}
|
|
1033
|
-
if (typeof
|
|
1034
|
-
message += `from "${
|
|
1035
|
+
if (typeof error.plugin !== "undefined") {
|
|
1036
|
+
message += `from "${error.plugin}" plugin: `;
|
|
1035
1037
|
}
|
|
1036
|
-
message +=
|
|
1037
|
-
message += `${
|
|
1038
|
-
const code =
|
|
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
|
|
1043
|
-
|
|
1044
|
-
|
|
1044
|
+
const obj = new Error(message, {
|
|
1045
|
+
cause: error
|
|
1046
|
+
});
|
|
1047
|
+
obj.stack = null;
|
|
1048
|
+
return obj;
|
|
1045
1049
|
}
|