From 649b8b79fcbd6a2361bbf1807410c5ec5c81adc8 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Sun, 12 Apr 2026 12:09:44 -0400 Subject: [PATCH] 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. --- vite.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vite.config.ts b/vite.config.ts index d7e2342..5a9d364 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -20,7 +20,7 @@ export default defineConfig({ entryFileNames: "[name].js", }, }, - target: "es2020", + target: "esnext", sourcemap: true, minify: "esbuild", },