From b1c59d866add15ac4e8e052c537c013e5be33d24 Mon Sep 17 00:00:00 2001 From: uwap Date: Wed, 23 Nov 2022 12:07:32 +0100 Subject: [PATCH] Fix watch command not working --- webpack.config.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 3980a7d..6e23beb 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,10 +8,11 @@ const preBuildScripts = process.env.NO_FLOW == undefined ? : []; const configPath = env => { - if (env.length < 3) { + const filtered = Object.keys(env).filter((e) => !e.startsWith("WEBPACK")); + if (filtered.length < 1) { throw "No config file was provided."; } - return path.resolve(__dirname, `config/${Object.keys(env)[2]}`); + return path.resolve(__dirname, `config/${filtered[0]}`); }; module.exports = env => ({