@@ -23,30 +23,26 @@ const builtInFlags = [
23
23
// For configs
24
24
{
25
25
name : 'config' ,
26
- usage : '--config <path-to-config> | --config <path-to-config> --config <path-to-config>' ,
27
26
alias : 'c' ,
28
27
type : String ,
29
28
multiple : true ,
30
29
description : 'Provide path to a webpack configuration file e.g. ./webpack.config.js.' ,
31
30
} ,
32
31
{
33
32
name : 'config-name' ,
34
- usage : '--config-name <name-of-config> | --config-name <name-of-config> --config-name <name-of-config>' ,
35
33
type : String ,
36
34
multiple : true ,
37
35
description : 'Name of the configuration to use.' ,
38
36
} ,
39
37
{
40
38
name : 'merge' ,
41
- usage : '--config <first-config> --config <second-config> --merge' ,
42
39
alias : 'm' ,
43
40
type : Boolean ,
44
41
description : "Merge two or more configurations using 'webpack-merge'." ,
45
42
} ,
46
43
// Complex configs
47
44
{
48
45
name : 'env' ,
49
- usage : '--env <variable> | --env <variable> --env <variable=value>' ,
50
46
type : ( value , previous = { } ) => {
51
47
// This ensures we're only splitting by the first `=`
52
48
const [ allKeys , val ] = value . split ( / = ( .+ ) / , 2 ) ;
@@ -79,7 +75,6 @@ const builtInFlags = [
79
75
// Adding more plugins
80
76
{
81
77
name : 'hot' ,
82
- usage : '--hot' ,
83
78
alias : 'h' ,
84
79
type : Boolean ,
85
80
negative : true ,
@@ -88,28 +83,24 @@ const builtInFlags = [
88
83
} ,
89
84
{
90
85
name : 'analyze' ,
91
- usage : '--analyze' ,
92
86
type : Boolean ,
93
87
multiple : false ,
94
88
description : 'It invokes webpack-bundle-analyzer plugin to get bundle information.' ,
95
89
} ,
96
90
{
97
91
name : 'progress' ,
98
- usage : '--progress | --progress profile' ,
99
92
type : [ Boolean , String ] ,
100
93
description : 'Print compilation progress during build.' ,
101
94
} ,
102
95
{
103
96
name : 'prefetch' ,
104
- usage : '--prefetch <request>' ,
105
97
type : String ,
106
98
description : 'Prefetch this request.' ,
107
99
} ,
108
100
109
101
// Output options
110
102
{
111
103
name : 'json' ,
112
- usage : '--json | --json <path-to-stats-file>' ,
113
104
type : [ String , Boolean ] ,
114
105
alias : 'j' ,
115
106
description : 'Prints result as JSON or store it in a file.' ,
@@ -118,29 +109,25 @@ const builtInFlags = [
118
109
// For webpack@4
119
110
{
120
111
name : 'entry' ,
121
- usage : '--entry <path-to-entry-file> | --entry <path> --entry <path>' ,
122
112
type : String ,
123
113
multiple : true ,
124
114
description : 'The entry point(s) of your application e.g. ./src/main.js.' ,
125
115
} ,
126
116
{
127
117
name : 'output-path' ,
128
- usage : '--output-path <path-to-output-directory>' ,
129
118
alias : 'o' ,
130
119
type : String ,
131
120
description : 'Output location of the file generated by webpack e.g. ./dist/.' ,
132
121
} ,
133
122
{
134
123
name : 'target' ,
135
- usage : '--target <value> | --target <value> --target <value>' ,
136
124
alias : 't' ,
137
125
type : String ,
138
126
multiple : cli !== undefined ,
139
127
description : 'Sets the build target e.g. node.' ,
140
128
} ,
141
129
{
142
130
name : 'devtool' ,
143
- usage : '--devtool <value>' ,
144
131
type : String ,
145
132
negative : true ,
146
133
alias : 'd' ,
@@ -149,27 +136,23 @@ const builtInFlags = [
149
136
} ,
150
137
{
151
138
name : 'mode' ,
152
- usage : '--mode <development | production | none>' ,
153
139
type : String ,
154
140
description : 'Defines the mode to pass to webpack.' ,
155
141
} ,
156
142
{
157
143
name : 'name' ,
158
- usage : '--name' ,
159
144
type : String ,
160
145
description : 'Name of the configuration. Used when loading multiple configurations.' ,
161
146
} ,
162
147
{
163
148
name : 'stats' ,
164
- usage : '--stats | --stats <value>' ,
165
149
type : [ String , Boolean ] ,
166
150
negative : true ,
167
151
description : 'It instructs webpack on how to treat the stats e.g. verbose.' ,
168
152
negatedDescription : 'Disable stats output.' ,
169
153
} ,
170
154
{
171
155
name : 'watch' ,
172
- usage : '--watch' ,
173
156
type : Boolean ,
174
157
negative : true ,
175
158
alias : 'w' ,
@@ -178,7 +161,6 @@ const builtInFlags = [
178
161
} ,
179
162
{
180
163
name : 'watch-options-stdin' ,
181
- usage : '--watch-options-stdin' ,
182
164
type : Boolean ,
183
165
negative : true ,
184
166
description : 'Stop watching when stdin stream has ended.' ,
@@ -192,14 +174,11 @@ const coreFlags = cli
192
174
? Object . entries ( cli . getArguments ( ) ) . map ( ( [ flag , meta ] ) => {
193
175
if ( meta . simpleType === 'string' ) {
194
176
meta . type = String ;
195
- meta . usage = `--${ flag } <value>` ;
196
177
} else if ( meta . simpleType === 'number' ) {
197
178
meta . type = Number ;
198
- meta . usage = `--${ flag } <value>` ;
199
179
} else {
200
180
meta . type = Boolean ;
201
181
meta . negative = ! flag . endsWith ( '-reset' ) ;
202
- meta . usage = `--${ flag } ` ;
203
182
}
204
183
205
184
const inBuiltIn = builtInFlags . find ( ( builtInFlag ) => builtInFlag . name === flag ) ;
0 commit comments