File tree Expand file tree Collapse file tree 2 files changed +6
-16
lines changed Expand file tree Collapse file tree 2 files changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,7 @@ export default class AddGenerator extends Generator {
42
42
configName ?: string ;
43
43
topScope ?: string [ ] ;
44
44
item ?: string ;
45
- merge ?: {
46
- configName ?: string ;
47
- topScope ?: string [ ] ;
48
- item ?: string ;
49
- webpackOptions ?: WebpackOptions ;
50
- } ;
45
+ merge ?: string | string [ ] ;
51
46
webpackOptions ?: WebpackOptions ;
52
47
} ;
53
48
} ;
@@ -112,19 +107,14 @@ export default class AddGenerator extends Generator {
112
107
) ;
113
108
}
114
109
if ( action === "merge" ) {
115
- return this . prompt ( [ mergeFileQuestion ] )
110
+ return this . prompt ( mergeFileQuestion )
116
111
. then ( ( mergeFileAnswer : {
117
- mergeFile : string ;
112
+ mergeFile : string ,
113
+ mergeConfigName : string
118
114
} ) => {
119
115
const resolvedPath = resolve ( process . cwd ( ) , mergeFileAnswer . mergeFile ) ;
120
116
// eslint-disable-next-line
121
- const mergeConfig = require ( resolvedPath ) ;
122
- ( this . configuration . config . merge as {
123
- configName ?: string ;
124
- topScope ?: string [ ] ;
125
- item ?: string ;
126
- webpackOptions ?: WebpackOptions ;
127
- } ) = mergeConfig ;
117
+ this . configuration . config [ "merge" ] = [ mergeFileAnswer . mergeConfigName , resolvedPath ] ;
128
118
} ) ;
129
119
}
130
120
}
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export interface Config extends Object {
14
14
} ;
15
15
topScope ?: string [ ] ;
16
16
configName ?: string ;
17
- merge : object ;
17
+ merge : string | string [ ] ;
18
18
webpackOptions : object ;
19
19
}
20
20
You can’t perform that action at this time.
0 commit comments