File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,12 +42,7 @@ export default class AddGenerator extends Generator {
4242 configName ?: string ;
4343 topScope ?: string [ ] ;
4444 item ?: string ;
45- merge ?: {
46- configName ?: string ;
47- topScope ?: string [ ] ;
48- item ?: string ;
49- webpackOptions ?: WebpackOptions ;
50- } ;
45+ merge ?: string | string [ ] ;
5146 webpackOptions ?: WebpackOptions ;
5247 } ;
5348 } ;
@@ -112,19 +107,14 @@ export default class AddGenerator extends Generator {
112107 ) ;
113108 }
114109 if ( action === "merge" ) {
115- return this . prompt ( [ mergeFileQuestion ] )
110+ return this . prompt ( mergeFileQuestion )
116111 . then ( ( mergeFileAnswer : {
117- mergeFile : string ;
112+ mergeFile : string ,
113+ mergeConfigName : string
118114 } ) => {
119115 const resolvedPath = resolve ( process . cwd ( ) , mergeFileAnswer . mergeFile ) ;
120116 // 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 ] ;
128118 } ) ;
129119 }
130120 }
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export interface Config extends Object {
1414 } ;
1515 topScope ?: string [ ] ;
1616 configName ?: string ;
17- merge : object ;
17+ merge : string | string [ ] ;
1818 webpackOptions : object ;
1919}
2020
You can’t perform that action at this time.
0 commit comments