Lazy load JSZip on Download all button click (#850)

This commit is contained in:
Wojciech Maj
2022-10-26 08:46:19 +02:00
committed by GitHub
parent 0e340a2679
commit cc2ac8bfcd
+2 -1
View File
@@ -1,6 +1,5 @@
import { Button, Flex, Link, WrapItem, Text, Wrap, Heading } from '@chakra-ui/react';
import download from 'downloadjs';
import JSZip from 'jszip';
import { Download, Github } from 'lucide-react';
import NextLink from 'next/link';
import { IconCustomizerDrawer } from './IconCustomizerDrawer';
@@ -20,6 +19,8 @@ import { IconEntity } from '../types';
type IconContent = [icon: string, src:string];
async function generateZip(icons: IconContent[]) {
const JSZip = (await import('jszip')).default
const zip = new JSZip();
const addingZipPromises = icons.map(([name, src]) =>