UNPKG

842 BJavaScriptView Raw
1const merge = require('merge-options');
2
3module.exports = {
4 apply(argv, options) {
5 const result = {};
6
7 if (argv.configRegister) {
8 /* istanbul ignore next */
9 // eslint-disable-next-line no-param-reassign
10 argv.require = argv.configRegister;
11 }
12
13 if (argv.mode) {
14 result.mode = argv.mode;
15 }
16
17 return merge(options, result);
18 },
19
20 flags: {
21 config: {
22 desc: 'Path to the config file',
23 type: 'string',
24 },
25 'config-name': {
26 desc: 'Name of the config to use',
27 type: 'string',
28 },
29 'config-register': {
30 alias: 'r',
31 desc: '',
32 deprecated: '--require',
33 type: ['string', 'array'],
34 },
35 mode: {
36 desc: 'Specifies the build mode to use; development or production',
37 type: 'string',
38 },
39 },
40
41 name: 'Configuration File',
42};