From cc2ac8bfcd848ef62139fda08c33c7467b83316d Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Wed, 26 Oct 2022 08:46:19 +0200 Subject: [PATCH] Lazy load JSZip on Download all button click (#850) --- site/src/components/Header.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/src/components/Header.tsx b/site/src/components/Header.tsx index 32dc06aa8..d1c5a269c 100644 --- a/site/src/components/Header.tsx +++ b/site/src/components/Header.tsx @@ -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]) =>