• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MicroAppJS / plugin-webpack / 4647175977

pending completion
4647175977

push

github

Zyao89
bookmark: release v0.1.3

222 of 595 branches covered (37.31%)

Branch coverage included in aggregate %.

565 of 897 relevant lines covered (62.99%)

11.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

13.79
/src/extends/unified/utils/resolveLoaderError.js
1
'use strict';
2

3
const { chalk } = require('@micro-app/shared-utils');
4✔
4

5
const rules = [
4✔
6
    {
7
        type: 'cant-resolve-loader',
8
        re: /Can't resolve '(.*loader)'/,
9
        msg: (e, match) => (
10
            `Failed to resolve loader: ${chalk.yellow(match[1])}\n` +
×
11
      'You may need to install it.'
12
        ),
13
    },
14
];
15

16
exports.transformer = error => {
4✔
17
    if (error.webpackError) {
×
18
        const message = typeof error.webpackError === 'string'
×
19
            ? error.webpackError
20
            : error.webpackError.message || '';
×
21
        for (const { re, msg, type } of rules) {
×
22
            const match = message.match(re);
×
23
            if (match) {
×
24
                return Object.assign({}, error, {
×
25
                    // type is necessary to avoid being printed as defualt error
26
                    // by friendly-error-webpack-plugin
27
                    type,
28
                    shortMessage: msg(error, match),
29
                });
30
            }
31
        }
32
        // no match, unknown webpack error without a message.
33
        // friendly-error-webpack-plugin fails to handle this.
34
        if (!error.message) {
×
35
            return Object.assign({}, error, {
×
36
                type: 'unknown-webpack-error',
37
                shortMessage: message,
38
            });
39
        }
40
    }
41
    return error;
×
42
};
43

44
exports.formatter = errors => {
4✔
45
    errors = errors.filter(e => e.shortMessage);
×
46
    if (errors.length) {
×
47
        return errors.map(e => e.shortMessage);
×
48
    }
49
}
50
;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc