chore: wire vendored foliate-js into the build
$foliate is a Vite-only alias, deliberately absent from kit.alias and tsconfig paths: TypeScript cannot resolve it, so the ambient declaration in src/lib/reader/foliate.d.ts is the only candidate and svelte-check never walks the ~11k lines of untyped vendored JS. The generated tsconfig includes src/**/*.js and checkJs is on, so src/lib/vendor is excluded as well — `exclude` replaces rather than merges, hence the repeated service-worker entries. optimizeDeps.include for construct-style-sheets-polyfill: it sits behind a dynamic import in fixed-layout.js, so Vite would otherwise discover it mid-session and force a page reload on the first fixed-layout EPUB. Verified with a temporary import that the graph resolves: view.js and paginator.js are emitted as chunks, and the bundled pdf.js is our stub rather than upstream's bare `import '@pdfjs/pdf.min.mjs'`.
This commit is contained in:
+15
-1
@@ -10,7 +10,21 @@
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"moduleResolution": "bundler"
|
||||
}
|
||||
},
|
||||
// `exclude` replaces the generated list rather than merging with it, so the
|
||||
// service-worker entries from .svelte-kit/tsconfig.json are repeated here.
|
||||
// src/lib/vendor is added: it is vendored third-party JS and checkJs is on,
|
||||
// so without this svelte-check reports thousands of errors from foliate-js.
|
||||
"exclude": [
|
||||
"node_modules/**",
|
||||
"src/service-worker.js",
|
||||
"src/service-worker/**/*.js",
|
||||
"src/service-worker.ts",
|
||||
"src/service-worker/**/*.ts",
|
||||
"src/service-worker.d.ts",
|
||||
"src/service-worker/**/*.d.ts",
|
||||
"src/lib/vendor/**"
|
||||
]
|
||||
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
|
||||
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user