Merge pull request #10402 from Yama-Tomo/fixed-webpackFinal-being-called-twice

Fixed `webpackFinal` being called twice
This commit is contained in:
Norbert de Langen 2020-04-14 00:15:51 +02:00 committed by GitHub
commit bc5788c67b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,15 +20,11 @@ export async function webpack(config, options) {
// return the (extended) base configuration if it's not available.
const customConfig = loadCustomWebpackConfig(configDir);
if (customConfig === null) {
logger.info('=> Using default Webpack setup.');
return createFinalDefaultConfig(presets, config, options);
}
if (typeof customConfig === 'function') {
logger.info('=> Loading custom Webpack config (full-control mode).');
return customConfig({ config: finalDefaultConfig, mode: configType });
}
logger.info('=> Using default Webpack setup.');
return finalDefaultConfig;
}