-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvite.config.ts
More file actions
45 lines (43 loc) · 1.15 KB
/
vite.config.ts
File metadata and controls
45 lines (43 loc) · 1.15 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
import tailwindcss from '@tailwindcss/vite';
import vue from '@vitejs/plugin-vue';
import { Plugin, defineConfig } from 'vite';
export default defineConfig({
root: 'web',
build: {
rollupOptions: {
output: {
manualChunks: {
native: ['@tauri-apps/plugin-dialog', '@tauri-apps/plugin-http'],
vendor: ['marked', 'vue-router', 'vue'],
},
},
},
},
plugins: [
html({
APP_TITLE: `DBChat - Chat with your Database`,
APP_DESCRIPTION: `Use AI to chat with a MySQL/PostgreSQL database using Google/OpenAI/xAI models`,
APP_COVER: `https://raw.githubusercontent.com/PactInteractive/dbchat/master/web/assets/cover.png`,
}),
tailwindcss(),
vue(),
],
server: {
port: 3000,
strictPort: true, // Fail if 3000 is taken
proxy: {
'/api': {
target: 'http://localhost:3001',
changeOrigin: true,
},
},
},
});
function html(data: Record<string, any>): Plugin {
return {
name: 'html-replace',
transformIndexHtml(html) {
return Object.entries(data).reduce((result, [key, value]) => result.replaceAll(`%${key}%`, value), html);
},
};
}