• 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

45.83
/src/utils/validateWebpackConfig.js
1
'use strict';
2

3
module.exports = function validateWebpackConfig(
2✔
4
    webpackConfig,
5
    api,
6
    options,
7
    target = 'web'
×
8
) {
9
    const logger = api.logger;
6✔
10

11
    const singleConfig = Array.isArray(webpackConfig)
6!
12
        ? webpackConfig[0]
13
        : webpackConfig;
14

15
    const actualTargetDir = singleConfig.output.path;
6✔
16

17
    if (actualTargetDir !== api.resolve(options.outputDir)) {
6!
18
        // user directly modifies output.path in configureWebpack or chainWebpack.
19
        // this is not supported because there's no way for us to give copy
20
        // plugin the correct value this way.
21
        logger.warn('[validate]', 'outputDir:', options.outputDir, '!== output.path:', singleConfig.output.path);
×
22
        logger.error(
×
23
            'Configuration Error: ' +
24
            'Avoid modifying webpack output.path directly. ' +
25
            'Use the "outputDir" option instead.'
26
        );
27
        // fixed
28
        options.outputDir = singleConfig.output.path;
×
29
    }
30

31
    if (actualTargetDir === api.root) {
6!
32
        logger.warn('[validate]', 'root:', api.root, '!== output.path:', singleConfig.output.path);
×
33
        logger.throw(
×
34
            'Configuration Error: ' +
35
            'Do not set output directory to project root.'
36
        );
37
    }
38

39
    if (singleConfig.output.publicPath !== options.publicPath) {
6!
40
        logger.warn('[validate]', 'publicPath:', options.publicPath, '!== output.publicPath:', singleConfig.output.publicPath);
×
41
        logger.error(
×
42
            'Configuration Error: ' +
43
            'Avoid modifying webpack output.publicPath directly. ' +
44
            'Use the "publicPath" option instead.'
45
        );
46
        // fixed
47
        options.publicPath = singleConfig.output.publicPath;
×
48
    }
49
};
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