@@ -3,7 +3,8 @@ module.exports = (api, options) => {
33 description : 'inspect internal webpack config' ,
44 usage : 'vue-cli-service inspect [options] [...paths]' ,
55 options : {
6- '--mode' : 'specify env mode (default: development)'
6+ '--mode' : 'specify env mode (default: development)' ,
7+ '--verbose' : 'show full function definitions in output'
78 }
89 } , args => {
910 api . setMode ( args . mode || 'development' )
@@ -27,13 +28,15 @@ module.exports = (api, options) => {
2728
2829 const pluginRE = / (?: f u n c t i o n | c l a s s ) ( \w + P l u g i n ) /
2930 console . log ( stringify ( res , ( value , indent , stringify ) => {
30- if ( typeof value === 'function' && value . toString ( ) . length > 100 ) {
31- return `function () { /* omitted long function */ }`
32- }
33- if ( value && typeof value . constructor === 'function' ) {
34- const match = value . constructor . toString ( ) . match ( pluginRE )
35- if ( match ) {
36- return `/* ${ match [ 1 ] } */ ` + stringify ( value )
31+ if ( ! args . verbose ) {
32+ if ( typeof value === 'function' && value . toString ( ) . length > 100 ) {
33+ return `function () { /* omitted long function */ }`
34+ }
35+ if ( value && typeof value . constructor === 'function' ) {
36+ const match = value . constructor . toString ( ) . match ( pluginRE )
37+ if ( match ) {
38+ return `/* ${ match [ 1 ] } */ ` + stringify ( value )
39+ }
3740 }
3841 }
3942 return stringify ( value )
0 commit comments