This repository was archived by the owner on Dec 6, 2025. It is now read-only.
forked from martin-pabst/SQL-IDE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
50 lines (47 loc) · 1.51 KB
/
vite.config.ts
File metadata and controls
50 lines (47 loc) · 1.51 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
46
47
48
49
50
import { type UserConfig } from 'vite'
import commonConfig from './vite.config-common.ts'
export default {
...commonConfig,
build: {
sourcemap: true,
rollupOptions: {
input: {
main: ('./index.html'),
// 'sqljs-worker': './src/client/sqljs-worker/sqljsWorker.ts'
},
output: {
entryFileNames: assetInfo => {
if(assetInfo.name.indexOf('worker') >= 0){
return 'worker/[name].js';
}
return '[name].js';
},
assetFileNames: assetInfo => assetInfo.name?.endsWith('css') ? '[name][extname]' : 'assets/[name][extname]',
chunkFileNames: 'assets/js/[name].js',
manualChunks: (id: string, { getModuleInfo, getModuleIds }) => {
if (id.includes('node_modules')) {
let moduleName: string = id.toString().split('node_modules/')[1].split('/')[0].toString().replace("@", "");
if (id.endsWith('.css')) {
return moduleName + '_css';
}
return moduleName;
}
return undefined;
},
}
},
outDir: './dist',
// chunkSizeWarningLimit: 4912
},
server: {
proxy: {
'/servlet': 'http://localhost:6500',
'/servlet/websocket': { target: 'ws://localhost:6500', ws: true },
'/servlet/pushWebsocket': { target: 'ws://localhost:6500', ws: true },
'/worker': {
rewrite: (path) => path.replace('/worker', '/dist/worker'),
target: "http://localhost:4000"
}
}
},
} satisfies UserConfig;