Skip to content

Commit 1efdc40

Browse files
committed
fix: Adds try catch to keepChunks
1 parent f43ceef commit 1efdc40

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/keepChunks.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function filterOutMapFiles(files) {
7171
*/
7272
function downloadUrls(urls) {
7373
return Promise.all(
74-
urls.map(url => {
74+
urls.map((url) => {
7575
const downloadPath = url
7676
.slice(0, url.lastIndexOf('/'))
7777
.replace(PUBLIC_URL, '');
@@ -95,13 +95,15 @@ async function keepChunks() {
9595
.reduce((acc, current) => {
9696
return acc.concat(Object.values(current.files));
9797
}, [])
98-
.filter(url =>
98+
.filter((url) =>
9999
['index.html', 'loadable-stats.json', 'service-worker.js'].every(
100-
ignored => !url.includes(ignored),
100+
(ignored) => !url.includes(ignored),
101101
),
102102
);
103103

104-
await downloadUrls(urls);
104+
try {
105+
await downloadUrls(urls);
106+
} catch (e) {}
105107

106108
// update assetHistory
107109
assetHistory.history.push({

0 commit comments

Comments
 (0)