Skip to content

Commit

Permalink
fix: correctly removing old version of app
Browse files Browse the repository at this point in the history
TheSlimvReal authored Oct 20, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent ac21907 commit c3d3027
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build/merge-service-workers.js
Original file line number Diff line number Diff line change
@@ -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`
);

0 comments on commit c3d3027

Please sign in to comment.