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:
+1
-1
@@ -20,7 +20,7 @@ export default defineConfig({
|
||||
entryFileNames: "[name].js",
|
||||
},
|
||||
},
|
||||
target: "es2020",
|
||||
target: "esnext",
|
||||
sourcemap: true,
|
||||
minify: "esbuild",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user