File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
packages/@vue/cli-service/lib/commands Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,18 @@ module.exports = (api, options) => {
2525 res = config
2626 }
2727
28- // TODO improve stringification for loaders, plugins etc.
29- console . log ( stringify ( res , null , 2 ) )
28+ const pluginRE = / (?: f u n c t i o n | c l a s s ) ( \w + P l u g i n ) /
29+ 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 )
37+ }
38+ }
39+ return stringify ( value )
40+ } , 2 ) )
3041 } )
3142}
You can’t perform that action at this time.
0 commit comments