feat: Dynamically load jspdf and html2canvas-pro to improve first-screen loading speed

This commit is contained in:
Shirasawa
2025-09-17 07:54:51 +00:00
parent 980019bb50
commit df433f852f
4 changed files with 20 additions and 12 deletions
@@ -6,9 +6,6 @@
import fileSaver from 'file-saver';
const { saveAs } = fileSaver;
import jsPDF from 'jspdf';
import html2canvas from 'html2canvas-pro';
const dispatch = createEventDispatcher();
import Dropdown from '$lib/components/common/Dropdown.svelte';
@@ -91,6 +88,11 @@
return;
}
const [{ default: jsPDF }, { default: html2canvas }] = await Promise.all([
import('jspdf'),
import('html2canvas-pro')
]);
if ($settings?.stylizedPdfExport ?? true) {
showFullMessages = true;
await tick();