@@ -3,7 +3,6 @@ const { resolve, extname } = require('path');
3
3
const webpackMerge = require ( 'webpack-merge' ) ;
4
4
const { extensions, jsVariants } = require ( 'interpret' ) ;
5
5
const rechoir = require ( 'rechoir' ) ;
6
- const ConfigError = require ( '../utils/errors/ConfigError' ) ;
7
6
const logger = require ( '../utils/logger' ) ;
8
7
9
8
// Order defines the priority, in increasing order
@@ -92,7 +91,8 @@ const resolveConfigFiles = async (args) => {
92
91
const configFiles = getConfigInfoFromFileName ( configPath ) ;
93
92
94
93
if ( ! configFiles . length ) {
95
- throw new ConfigError ( `The specified config file doesn't exist in ${ configPath } ` ) ;
94
+ logger . error ( `The specified config file doesn't exist in ${ configPath } ` ) ;
95
+ process . exit ( 2 ) ;
96
96
}
97
97
98
98
const foundConfig = configFiles [ 0 ] ;
@@ -230,12 +230,12 @@ const resolveConfigMerging = async (args) => {
230
230
// either by passing multiple configs by flags or passing a
231
231
// single config exporting an array
232
232
if ( ! Array . isArray ( configOptions ) ) {
233
- throw new ConfigError ( 'Atleast two configurations are required for merge.' , 'MergeError' ) ;
233
+ logger . error ( 'At least two configurations are required for merge.' ) ;
234
+ process . exit ( 2 ) ;
234
235
}
235
236
236
237
// We return a single config object which is passed to the compiler
237
- const mergedOptions = configOptions . reduce ( ( currentConfig , mergedConfig ) => webpackMerge ( currentConfig , mergedConfig ) , { } ) ;
238
- opts [ 'options' ] = mergedOptions ;
238
+ opts [ 'options' ] = configOptions . reduce ( ( currentConfig , mergedConfig ) => webpackMerge ( currentConfig , mergedConfig ) , { } ) ;
239
239
}
240
240
} ;
241
241
0 commit comments