chore: vendor foliate-js

foliate-js has no npm release and no build step; upstream recommends a git
submodule. Copy it instead: this repo has no submodules and already vendors
pdf.js the same way under static/pdfjs, and a submodule would pull in 231
files / 13 MB of which 191 files / 12 MB is a bundled pdf.js build that
Chitai does not use.

Only the import closure reachable from view.js is vendored — 15 files, 584K.
pdf.js is replaced by a stub that throws: view.js reaches it through a
static-string dynamic import inside makeBook, which Rollup resolves at build
time even though Chitai serves PDFs from static/pdfjs/web/viewer.html, and
upstream's version opens with a bare `import '@pdfjs/pdf.min.mjs'` that does
not resolve here.

scripts/vendor-foliate.sh pins the commit and makes the next update a one-line
change. fixed-layout.js needs construct-style-sheets-polyfill, so add it.
This commit is contained in:
2026-08-11 21:59:33 -04:00
parent a1281f129c
commit dd65e34869
24 changed files with 11543 additions and 1 deletions
+1
View File
@@ -47,6 +47,7 @@
"vite": "^7.3.1"
},
"dependencies": {
"construct-style-sheets-polyfill": "^3.1.0",
"epubjs": "^0.3.93",
"mode-watcher": "^1.1.0",
"svelte-sonner": "^1.0.8",