forked from kyutai-labs/moshi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
32 lines (31 loc) · 879 Bytes
/
vite.config.ts
File metadata and controls
32 lines (31 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { ProxyOptions, defineConfig, loadEnv } from "vite";
import topLevelAwait from "vite-plugin-top-level-await";
export default defineConfig(({mode}) => {
const env = loadEnv(mode, process.cwd());
const proxyConf:Record<string, string | ProxyOptions> = env.VITE_QUEUE_API_URL ? {
"/api": {
target: env.VITE_QUEUE_API_URL,
changeOrigin: true,
},
} : {};
return {
server: {
host: "0.0.0.0",
https: {
cert: "./cert.pem",
key: "./key.pem",
},
proxy:{
...proxyConf,
}
},
plugins: [
topLevelAwait({
// The export name of top-level await promise for each chunk module
promiseExportName: "__tla",
// The function to generate import names of top-level await promise in each chunk module
promiseImportName: i => `__tla_${i}`,
}),
],
};
});