-
-
Notifications
You must be signed in to change notification settings - Fork 594
/
cli-flags.js
201 lines (200 loc) · 5.35 KB
/
cli-flags.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
const HELP_GROUP = 'Help options:';
const CONFIG_GROUP = 'Config options:';
const BASIC_GROUP = 'Basic options:';
const OUTPUT_GROUP = 'Output options:';
const ADVANCED_GROUP = 'Advanced options:';
const DISPLAY_GROUP = 'Stats options:';
module.exports = {
commands: [
{
name: 'create',
alias: 'c',
type: String,
description: 'Initialize a new webpack configuration',
},
{
name: 'migrate',
alias: 'm',
type: String,
description: 'Migrate a configuration to a new version',
},
{
name: 'loader',
scope: 'external',
alias: 'l',
type: String,
description: 'Scaffold a loader repository',
},
{
name: 'plugin',
alias: 'p',
scope: 'external',
type: String,
description: 'Scaffold a plugin repository',
},
{
name: 'info',
scope: 'external',
type: String,
description: 'Outputs information about your system and dependencies',
},
{
name: 'serve',
scope: 'external',
type: String,
description: 'Run the webpack Dev Server',
},
],
core: [
{
name: 'entry',
type: String,
multiple: false,
defaultValue: null,
defaultOption: true,
group: BASIC_GROUP,
description: 'The entry point of your application',
},
{
name: 'config',
alias: 'c',
type: String,
defaultValue: null,
group: CONFIG_GROUP,
description: 'Provide path to a webpack configuration file',
},
{
name: 'register',
type: String,
multiple: true,
alias: 'r',
group: CONFIG_GROUP,
description: 'Preload one or more modules before loading the webpack configuration',
},
{
name: 'merge',
alias: 'm',
type: String,
group: CONFIG_GROUP,
description: 'Merge a configuration file',
},
{
name: 'progress',
type: String,
defaultValue: 'bar',
group: BASIC_GROUP,
description: 'Print compilation progress during build',
},
{
name: 'help',
type: Boolean,
group: HELP_GROUP,
description: 'Outputs list of supported flags',
},
{
name: 'output',
alias: 'o',
group: OUTPUT_GROUP,
type: String,
description: 'Output location of the file generated by webpack',
},
{
name: 'plugin',
group: ADVANCED_GROUP,
type: String,
description: 'Load a given plugin'
},
{
name: 'global',
alias: 'g',
type: String,
multiple: true,
group: ADVANCED_GROUP,
description: 'Declares and exposes a global variable',
},
{
name: 'target',
alias: 't',
defaultValue: 'web',
type: String,
group: ADVANCED_GROUP,
description: 'Sets the build target',
},
{
name: 'watch',
type: Boolean,
alias: 'w',
group: BASIC_GROUP,
description: 'Watch for files changes',
},
{
name: 'hot',
alias: 'h',
type: Boolean,
group: ADVANCED_GROUP,
description: 'Enables Hot Module Replacement',
},
{
name: 'debug',
type: Boolean,
group: ADVANCED_GROUP,
description: 'Switch loaders to debug mode',
},
{
name: 'sourcemap',
type: String,
alias: 's',
defaultValue: 'eval',
group: BASIC_GROUP,
description: 'Determine source maps to use',
},
{
name: 'prefetch',
type: String,
group: ADVANCED_GROUP,
description: 'Prefetch this request',
},
{
name: 'json',
type: Boolean,
alias: 'j',
description: 'Prints result as JSON',
group: DISPLAY_GROUP,
},
{
name: 'dev',
alias: 'd',
type: Boolean,
defaultValue: undefined,
group: BASIC_GROUP,
description: 'Run development build',
},
{
name: 'prod',
alias: 'p',
type: Boolean,
defaultValue: undefined,
group: BASIC_GROUP,
description: 'Run production build',
},
{
name: 'version',
type: Boolean,
group: BASIC_GROUP,
description: 'Get current version',
},
/* {
name: "analyze",
type: Boolean,
group: BASIC_GROUP,
description: "analyze build for performance improvements"
}, */
/* {
name: "interactive",
type: Boolean,
alias: "i",
description: "Use webpack interactively",
group: BASIC_GROUP
} */
],
};