@@ -6,51 +6,36 @@ function mergeGlobalProperties(
6
6
configGlobal : GlobalMountOptions = { } ,
7
7
mountGlobal : GlobalMountOptions = { }
8
8
) : GlobalMountOptions {
9
- const {
10
- mixins : configMixins = [ ] ,
11
- plugins : configPlugins = [ ] ,
12
- ...configRest
13
- } = configGlobal
14
- const {
15
- mixins : mountMixins = [ ] ,
16
- plugins : mountPlugins = [ ] ,
17
- ...mountRest
18
- } = mountGlobal
19
- const mixins = [ ...configMixins , ...mountMixins ]
20
- const plugins = [ ...configPlugins , ...mountPlugins ]
21
-
22
9
const stubs : Record < string , any > = { }
23
-
24
- if ( configRest . stubs ) {
25
- if ( Array . isArray ( configRest . stubs ) ) {
26
- configRest . stubs . forEach ( ( x ) => ( stubs [ x ] = true ) )
10
+ if ( configGlobal . stubs ) {
11
+ if ( Array . isArray ( configGlobal . stubs ) ) {
12
+ configGlobal . stubs . forEach ( ( x ) => ( stubs [ x ] = true ) )
27
13
} else {
28
- for ( const [ k , v ] of Object . entries ( configRest . stubs ) ) {
14
+ for ( const [ k , v ] of Object . entries ( configGlobal . stubs ) ) {
29
15
stubs [ k ] = v
30
16
}
31
17
}
32
18
}
33
19
34
- if ( mountRest . stubs ) {
35
- if ( mountRest . stubs && Array . isArray ( mountRest . stubs ) ) {
36
- mountRest . stubs . forEach ( ( x ) => ( stubs [ x ] = true ) )
20
+ if ( mountGlobal . stubs ) {
21
+ if ( mountGlobal . stubs && Array . isArray ( mountGlobal . stubs ) ) {
22
+ mountGlobal . stubs . forEach ( ( x ) => ( stubs [ x ] = true ) )
37
23
} else {
38
- for ( const [ k , v ] of Object . entries ( mountRest . stubs ) ) {
24
+ for ( const [ k , v ] of Object . entries ( mountGlobal . stubs ) ) {
39
25
stubs [ k ] = v
40
26
}
41
27
}
42
28
}
43
29
44
30
return {
45
- mixins,
46
- plugins,
31
+ mixins : [ ... ( configGlobal . mixins || [ ] ) , ... ( mountGlobal . mixins || [ ] ) ] ,
32
+ plugins : [ ... ( configGlobal . plugins || [ ] ) , ... ( mountGlobal . plugins || [ ] ) ] ,
47
33
stubs,
48
- components : { ...configRest . components , ...mountRest . components } ,
49
- provide : { ...configRest . provide , ...mountRest . provide } ,
50
- mocks : { ...configRest . mocks , ...mountRest . mocks } ,
51
- config : { ...configRest . config , ...mountRest . config } ,
52
- directives : { ...configRest . directives , ...mountRest . directives }
53
- // stubs: { configRest.stubs, ...mountRest.stubs }
34
+ components : { ...configGlobal . components , ...mountGlobal . components } ,
35
+ provide : { ...configGlobal . provide , ...mountGlobal . provide } ,
36
+ mocks : { ...configGlobal . mocks , ...mountGlobal . mocks } ,
37
+ config : { ...configGlobal . config , ...mountGlobal . config } ,
38
+ directives : { ...configGlobal . directives , ...mountGlobal . directives }
54
39
}
55
40
}
56
41
0 commit comments