Dynamic Imports

This commit is contained in:
Felix Kaspar
2024-01-28 21:22:59 +01:00
parent fbc921a077
commit 50ab159abe
5 changed files with 29 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import topLevelAwait from "vite-plugin-top-level-await";
import dynamicImport from 'vite-plugin-dynamic-import'
// https://vitejs.dev/config/
export default defineConfig(async () => ({
@@ -12,6 +13,7 @@ export default defineConfig(async () => ({
// The function to generate import names of top-level await promise in each chunk module
promiseImportName: i => `__tla_${i}`
}),
dynamicImport(),
],
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`