Skip to content

Commit e89af45

Browse files
committed
Use dynamic imports for jszip.
1 parent c405844 commit e89af45

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/actions/receive-profile.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44
import { oneLine } from 'common-tags';
55
import queryString from 'query-string';
6-
import JSZip from 'jszip';
6+
import type JSZip from 'jszip';
77
import {
88
insertExternalMarkersIntoProfile,
99
insertExternalPowerCountersIntoProfile,
@@ -1045,6 +1045,7 @@ async function _extractZipFromResponse(
10451045
// that comes from this realm.
10461046
const typedBuffer = new Uint8Array(buffer);
10471047
try {
1048+
const JSZip = await import('jszip');
10481049
const zip = await JSZip.loadAsync(typedBuffer);
10491050
// Catch the error if unable to load the zip.
10501051
return zip;
@@ -1235,6 +1236,7 @@ export function retrieveProfileFromFile(
12351236
if (_deduceContentType(file.name, file.type) === 'application/zip') {
12361237
// Open a zip file in the zip file viewer
12371238
const buffer = await fileReader(file).asArrayBuffer();
1239+
const JSZip = await import('jszip');
12381240
const zip = await JSZip.loadAsync(buffer);
12391241
await dispatch(receiveZipFile(zip));
12401242
} else {

0 commit comments

Comments
 (0)