You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
682 B

  1. // @ts-nocheck
  2. 'use strict';
  3. const PrettyError = require('pretty-error');
  4. const prettyError = new PrettyError();
  5. prettyError.withoutColors();
  6. prettyError.skipPackage('html-plugin-evaluation');
  7. prettyError.skipNodeFiles();
  8. prettyError.skip(function (traceLine) {
  9. return traceLine.path === 'html-plugin-evaluation';
  10. });
  11. module.exports = function (err, context) {
  12. return {
  13. toHtml: function () {
  14. return 'Html Webpack Plugin:\n<pre>\n' + this.toString() + '</pre>';
  15. },
  16. toJsonHtml: function () {
  17. return JSON.stringify(this.toHtml());
  18. },
  19. toString: function () {
  20. return prettyError.render(err).replace(/webpack:\/\/\/\./g, context);
  21. }
  22. };
  23. };