From 5fa43fafb401c33cbda82b3ba342fe52935c1bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Mon, 8 Jun 2020 19:41:44 +0200 Subject: [PATCH] safer getBundles --- source/getBundles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/getBundles.js b/source/getBundles.js index 5462939..c73045b 100644 --- a/source/getBundles.js +++ b/source/getBundles.js @@ -24,7 +24,7 @@ function getBundles(manifest, chunks) { }, []); return assetsKey.reduce((bundle, asset) => { - Object.keys(manifest.assets[asset]).forEach((key) => { + Object.keys(manifest.assets[asset] || {}).forEach((key) => { const content = manifest.assets[asset][key]; if (!bundle[key]) { bundle[key] = []; } bundle[key] = unique([...bundle[key], ...content]);