SassError.js 891 B

1234567891011121314151617181920212223242526272829303132
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. class SassError extends Error {
  7. constructor(sassError) {
  8. super();
  9. this.name = "SassError";
  10. this.originalSassError = sassError;
  11. this.loc = {
  12. line: sassError.line,
  13. column: sassError.column
  14. }; // Keep original error if `sassError.formatted` is unavailable
  15. this.message = `${this.name}: ${this.originalSassError.message}`;
  16. if (this.originalSassError.formatted) {
  17. this.message = `${this.name}: ${this.originalSassError.formatted.replace(/^Error: /, "")}`; // Instruct webpack to hide the JS stack from the console.
  18. // Usually you're only interested in the SASS stack in this case.
  19. this.hideStack = true;
  20. Error.captureStackTrace(this, this.constructor);
  21. }
  22. }
  23. }
  24. var _default = SassError;
  25. exports.default = _default;