gx
chenyc
2025-06-12 7b72ac13a83764a662159d4a49b7fffb90476ecb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'use strict';
 
module.exports = {
  pkg: {
    patches: {
      'lib/error.js': [
        'return err;',
        'if (err.message.indexOf("SyntaxError") >= 0) {' +
          'err.message = "Pkg: Try to specify your ' +
          "javascript file in 'assets' in config. \" + err.message;" +
          '};\n' +
          'return err;',
        'if (Error.captureStackTrace) {',
        'if (this.message.indexOf("SyntaxError") >= 0) {' +
          'this.message = "Pkg: Try to specify your ' +
          "javascript file in 'assets' in config. \" + this.message;" +
          '};\n' +
          'if (Error.captureStackTrace) {',
      ],
    },
  },
};