2024-08-19 18:00:03 +08:00
|
|
|
import { sveltekit } from "@sveltejs/kit/vite";
|
|
|
|
import { defineConfig } from "vite";
|
|
|
|
import {
|
|
|
|
generate_cdn_entry,
|
|
|
|
generate_dev_entry,
|
|
|
|
handle_ce_css,
|
|
|
|
inject_component_loader,
|
|
|
|
inject_ejs,
|
|
|
|
mock_modules,
|
|
|
|
resolve_svelte
|
2024-08-23 00:38:45 +08:00
|
|
|
} from "@self/build";
|
2024-08-31 14:19:51 +08:00
|
|
|
import { fileURLToPath, URL } from "node:url";
|
2024-08-19 18:00:03 +08:00
|
|
|
|
|
|
|
export default defineConfig({
|
2024-08-23 00:38:45 +08:00
|
|
|
plugins: [sveltekit()],
|
2024-08-31 14:19:51 +08:00
|
|
|
|
2024-08-23 00:38:45 +08:00
|
|
|
resolve: {
|
2024-08-31 14:19:51 +08:00
|
|
|
conditions: ["gradio"],
|
|
|
|
alias: {
|
|
|
|
"@": fileURLToPath(new URL("./src", import.meta.url))
|
|
|
|
}
|
|
|
|
},
|
|
|
|
optimizeDeps: {
|
|
|
|
exclude: [
|
|
|
|
"@gradio/video",
|
|
|
|
"@ffmpeg/ffmpeg",
|
|
|
|
"@ffmpeg/util",
|
|
|
|
"@gradio/utils"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
assetsInclude: ["**/*.glb"],
|
|
|
|
server: {
|
|
|
|
headers: {
|
|
|
|
"Cross-Origin-Opener-Policy": "same-origin",
|
|
|
|
"Cross-Origin-Embedder-Policy": "require-corp"
|
|
|
|
},
|
|
|
|
fs: {
|
|
|
|
allow: ["../.."]
|
|
|
|
}
|
2024-08-23 00:38:45 +08:00
|
|
|
}
|
2024-08-19 18:00:03 +08:00
|
|
|
});
|