From 76504033a73385a92ea7c27e74a4257a6fbb6ec6 Mon Sep 17 00:00:00 2001 From: Marcin Tolysz Date: Wed, 22 May 2024 12:16:08 +0100 Subject: [PATCH] Add handling for arrays in webpackConfig processing --- lib/validate.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/validate.js b/lib/validate.js index eda743aae..3b60b3b68 100644 --- a/lib/validate.js +++ b/lib/validate.js @@ -305,7 +305,12 @@ module.exports = { }); this.webpackConfig = _.map(this.entryFunctions, entryFunc => { - const config = _.cloneDeep(this.webpackConfig); + // handle array + const config = + _.isArray(this.webpackConfig) && this.webpackConfig.length + ? _.cloneDeep(_.find(this.webpackConfig, c => c.entry[entryFunc.entry.key] !== undefined)) + : _.cloneDeep(this.webpackConfig); + config.entry = { [entryFunc.entry.key]: entryFunc.entry.value };