File tree 3 files changed +12
-2
lines changed
3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,10 @@ module.exports = (api, options) => {
83
83
usage : 'vue-cli-service inspect [options] [...paths]' ,
84
84
options : {
85
85
'--mode' : 'specify env mode (default: development)' ,
86
- '--rule' : 'inspect a specific module rule' ,
87
- '--plugin' : 'inspect a specific plugin' ,
86
+ '--rule <ruleName>' : 'inspect a specific module rule' ,
87
+ '--plugin <pluginName>' : 'inspect a specific plugin' ,
88
+ '--rules' : 'list all module rule names' ,
89
+ '--plugins' : 'list all plugin names' ,
88
90
'--verbose' : 'show full function definitions in output'
89
91
}
90
92
} , args => {
@@ -100,6 +102,10 @@ module.exports = (api, options) => {
100
102
res = config . module . rules . find ( r => r . __ruleName === args . rule )
101
103
} else if ( args . plugin ) {
102
104
res = config . plugins . find ( p => p . __pluginName === args . plugin )
105
+ } else if ( args . rules ) {
106
+ res = config . module . rules . map ( r => r . __ruleName )
107
+ } else if ( args . plugins ) {
108
+ res = config . plugins . map ( p => p . __pluginName )
103
109
} else if ( paths . length > 1 ) {
104
110
res = { }
105
111
paths . forEach ( path => {
Original file line number Diff line number Diff line change @@ -70,6 +70,8 @@ program
70
70
. option ( '--mode <mode>' )
71
71
. option ( '--rule <ruleName>' , 'inspect a specific module rule' )
72
72
. option ( '--plugin <pluginName>' , 'inspect a specific plugin' )
73
+ . option ( '--rules' , 'list all module rule names' )
74
+ . option ( '--plugins' , 'list all plugin names' )
73
75
. option ( '-v --verbose' , 'Show full function definitions in output' )
74
76
. description ( 'inspect the webpack config in a project with vue-cli-service' )
75
77
. action ( ( paths , cmd ) => {
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ module.exports = function inspect (paths, args) {
21
21
...( args . mode ? [ '--mode' , args . mode ] : [ ] ) ,
22
22
...( args . rule ? [ '--rule' , args . rule ] : [ ] ) ,
23
23
...( args . plugin ? [ '--plugin' , args . plugin ] : [ ] ) ,
24
+ ...( args . rules ? [ '--rules' ] : [ ] ) ,
25
+ ...( args . plugins ? [ '--plugins' ] : [ ] ) ,
24
26
...( args . verbose ? [ '--verbose' ] : [ ] ) ,
25
27
...paths
26
28
] , { cwd, stdio : 'inherit' } )
You can’t perform that action at this time.
0 commit comments