From c3d30275f4547c67ebfedb4001a6021b011e1348 Mon Sep 17 00:00:00 2001 From: Simon <33730997+TheSlimvReal@users.noreply.github.com> Date: Wed, 20 Oct 2021 09:54:10 +0200 Subject: [PATCH] fix: correctly removing old version of app --- build/merge-service-workers.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/merge-service-workers.js b/build/merge-service-workers.js index 6d3bbe83b8..21aba0b42d 100644 --- a/build/merge-service-workers.js +++ b/build/merge-service-workers.js @@ -34,6 +34,10 @@ locales.forEach((locale) => { Object.assign(combined.hashTable, additional.hashTable); fs.unlinkSync(`${distFolder}/${locale}/ngsw.json`); fs.unlinkSync(`${distFolder}/${locale}/ngsw-worker.js`); + fs.renameSync( + `${distFolder}/${locale}/safety-worker.js`, + `${distFolder}/${locale}/ngsw-worker.js` + ); }); combined.index = "/index.html"; @@ -51,3 +55,7 @@ const patchedSw = swFile.replace( ); fs.writeFileSync(`${distFolder}/ngsw-worker.js`, patchedSw); fs.unlinkSync(`${distFolder}/${firstLocale}/ngsw-worker.js`); +fs.renameSync( + `${distFolder}/${firstLocale}/safety-worker.js`, + `${distFolder}/${firstLocale}/ngsw-worker.js` +);