SassError.js 1007 B

123456789101112131415161718192021222324252627282930313233
  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, resourcePath) {
  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: /, '').replace(/(\s*)stdin(\s*)/, `$1${resourcePath}$2`)}`; // Instruct webpack to hide the JS stack from the console.
  18. // Usually you're only interested in the SASS stack in this case.
  19. // eslint-disable-next-line no-param-reassign
  20. this.hideStack = true;
  21. Error.captureStackTrace(this, this.constructor);
  22. }
  23. }
  24. }
  25. var _default = SassError;
  26. exports.default = _default;