MCPcopy Index your code
hub / github.com/webpack/css-loader / syntaxErrorFactory

Function syntaxErrorFactory

src/utils.js:1423–1448  ·  view source on GitHub ↗
(error)

Source from the content-addressed store, hash-verified

1421}
1422
1423function syntaxErrorFactory(error) {
1424 let message = "\nSyntaxError\n\n";
1425
1426 if (typeof error.line !== "undefined") {
1427 message += `(${error.line}:${error.column}) `;
1428 }
1429
1430 if (typeof error.plugin !== "undefined") {
1431 message += `from "${error.plugin}" plugin: `;
1432 }
1433
1434 message += error.file ? `${error.file} ` : "<css input> ";
1435 message += `${error.reason}`;
1436
1437 const code = error.showSourceCode();
1438
1439 if (code) {
1440 message += `\n\n${code}\n`;
1441 }
1442
1443 const obj = new Error(message, { cause: error });
1444
1445 obj.stack = null;
1446
1447 return obj;
1448}
1449
1450function supportTemplateLiteral(loaderContext) {
1451 if (loaderContext.environment && loaderContext.environment.templateLiteral) {

Callers 1

loaderFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected