File tree 2 files changed +9
-6
lines changed
packages/@vue/cli-ui/src/graphql-api
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ class PluginApi {
13
13
this . tasks = [ ]
14
14
this . clientAddons = [ ]
15
15
this . actions = new Map ( )
16
+ this . pluginId = null
16
17
}
17
18
18
19
describeConfig ( options ) {
@@ -23,9 +24,9 @@ class PluginApi {
23
24
logs . add ( {
24
25
type : 'error' ,
25
26
tag : 'PluginApi' ,
26
- message : 'describeConfig options are invalid\n' +
27
- e . message
27
+ message : `(${ this . pluginId || 'unknown plugin' } ) 'describeConfig' options are invalid\n${ e . message } `
28
28
} , this . context )
29
+ console . error ( new Error ( `Invalid options: ${ e . message } ` ) )
29
30
}
30
31
}
31
32
@@ -37,9 +38,9 @@ class PluginApi {
37
38
logs . add ( {
38
39
type : 'error' ,
39
40
tag : 'PluginApi' ,
40
- message : 'describeTask options are invalid\n' +
41
- e . message
41
+ message : `(${ this . pluginId || 'unknown plugin' } ) 'describeTask' options are invalid\n${ e . message } `
42
42
} , this . context )
43
+ console . error ( new Error ( `Invalid options: ${ e . message } ` ) )
43
44
}
44
45
}
45
46
@@ -57,9 +58,9 @@ class PluginApi {
57
58
logs . add ( {
58
59
type : 'error' ,
59
60
tag : 'PluginApi' ,
60
- message : 'addClientAddon options are invalid\n' +
61
- e . message
61
+ message : `(${ this . pluginId || 'unknown plugin' } ) 'addClientAddon' options are invalid\n${ e . message } `
62
62
} , this . context )
63
+ console . error ( new Error ( `Invalid options: ${ e . message } ` ) )
63
64
}
64
65
}
65
66
Original file line number Diff line number Diff line change @@ -89,7 +89,9 @@ function resetPluginApi (context) {
89
89
function runPluginApi ( id , context , fileName = 'ui' ) {
90
90
const module = loadModule ( `${ id } /${ fileName } ` , cwd . get ( ) , true )
91
91
if ( module ) {
92
+ pluginApi . pluginId = id
92
93
module ( pluginApi )
94
+ pluginApi . pluginId = null
93
95
}
94
96
}
95
97
You can’t perform that action at this time.
0 commit comments