build: Update Vite config for foliate-js integration

Update Vite configuration to support foliate-js library integration:

1. Add import alias for foliate-js:
   - Maps 'foliate-js' imports to web/vendor/foliate-js submodule
   - Allows clean imports: import { View } from 'foliate-js/view.js'

2. Update build target to ESNext:
   - Change from 'es2020' to 'esnext' to support top-level await
   - Required by foliate-js pdf.js which uses top-level await
   - ES2022+ support is excellent in all modern browsers (Chrome 112+, Firefox 115+, Safari 16.4+)

These changes enable Vite to bundle foliate-js into reader.js without
requiring a separate build step for the library.
This commit is contained in:
2026-04-12 12:09:44 -04:00
parent 231a1c64e3
commit 649b8b79fc
+1 -1
View File
@@ -20,7 +20,7 @@ export default defineConfig({
entryFileNames: "[name].js",
},
},
target: "es2020",
target: "esnext",
sourcemap: true,
minify: "esbuild",
},