Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ export default defineConfig({
rollupOptions: {
// Tauri API imports are only available in Tauri context, externalize for web build
external: [/^@tauri-apps\//],
output: {
// epub.js bundles from source (its `module` field is src/index.js) into a
// ~2 MB chunk that Rollup would otherwise name `index.*` — undetectable by
// the workbox globIgnore. Force stable names so the EPUB reader's heavy,
// lazily-imported deps stay out of the PWA precache (see globIgnores below).
// jszip is shared with docx-preview, so it gets its own chunk rather than
// being merged into epubjs.
manualChunks(id) {
if (id.includes('node_modules/epubjs')) return 'epubjs';
if (id.includes('node_modules/jszip')) return 'jszip';
},
},
},
},
// mupdf/pdf.js workers use dynamic import() (code-splitting), which requires
Expand Down Expand Up @@ -118,6 +130,8 @@ export default defineConfig({
'**/*huggingface*.js',
'**/maplibre-gl*.js',
'**/xlsx*.js',
'**/epubjs*.js',
'**/jszip*.js',
'og/*.png',
],
runtimeCaching: [
Expand Down
166 changes: 166 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"directories": {
"doc": "docs"
},
"overrides": {
"@xmldom/xmldom": "0.8.13"
},
"scripts": {
"copy:wasm": "node scripts/copy-wasm.mjs",
"og": "node scripts/generate-og.mjs",
Expand Down Expand Up @@ -77,6 +80,7 @@
"comlink": "^4.4.2",
"docx-preview": "^0.4.0",
"dompurify": "^3.4.12",
"epubjs": "^0.3.93",
"fast-xml-parser": "^5.10.0",
"fflate": "^0.8.3",
"gifenc": "^1.0.3",
Expand Down
Loading
Loading