From 9a82f88e1f72acb68117efb6bd754c4553c5ef6e Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 9 Dec 2021 15:13:19 +0100 Subject: [PATCH] log swSource as build fails in CI --- scripts/build-plugins/service-worker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build-plugins/service-worker.js b/scripts/build-plugins/service-worker.js index bd7d29d0..78d34b7f 100644 --- a/scripts/build-plugins/service-worker.js +++ b/scripts/build-plugins/service-worker.js @@ -100,14 +100,14 @@ function replaceCacheFilenamesInServiceWorker(swChunk, unhashedFilenames, assets const replaceArrayInSource = (name, value) => { const newSource = swSource.replace(`${name} = []`, `${name} = ${JSON.stringify(value)}`); if (newSource === swSource) { - throw new Error(`${name} was not found in the service worker source`); + throw new Error(`${name} was not found in the service worker source: ` + swSource); } return newSource; }; const replaceStringInSource = (name, value) => { const newSource = swSource.replace(new RegExp(`${name}\\s=\\s"[^"]*"`), `${name} = ${JSON.stringify(value)}`); if (newSource === swSource) { - throw new Error(`${name} was not found in the service worker source`); + throw new Error(`${name} was not found in the service worker source: ` + swSource); } return newSource; };