forked from martin-pabst/Online-IDE-new-compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
59 lines (54 loc) · 2.21 KB
/
vite.config.ts
File metadata and controls
59 lines (54 loc) · 2.21 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
51
52
53
54
55
56
57
58
59
import { searchForWorkspaceRoot, type UserConfig } from 'vite'
import commonConfig from './vite.config-common'
let serverIP: string = 'localhost';
// let serverIP: string = '172.30.95.53';
export default {
...commonConfig,
build: {
...commonConfig.build,
rollupOptions: {
input: {
main: './index.html',
admin: './administration_mc.html',
api: './api_documentation.html',
spriteLibrary: './spriteLibrary.html',
statistics: './statistics.html',
shortcuts: './shortcuts.html',
registeruser: './registerUser.html',
},
output: {
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;
},
}
// output: {
// entryFileNames: assetInfo => {
// if (assetInfo.name.indexOf('worker') >= 0) {
// return 'worker/[name].js';
// }
// return '[name]-[hash].js';
// },
// assetFileNames: assetInfo => assetInfo.name.endsWith('css') ? '[name]-[hash][extname]' : 'assets/[name]-[hash][extname]',
// chunkFileNames: 'assets/js/[name]-[hash].js',
// manualChunks: {}
// }
},
outDir: './dist',
},
server: {
proxy: {
'/servlet': 'http://' + serverIP + ':5500',
'/sprites': 'http://' + serverIP + ':5500',
'/servlet/websocket': { target: 'ws://' + serverIP + ':5500', ws: true },
'/servlet/pushWebsocket': { target: 'ws://' + serverIP + ':5500', ws: true }
// '/servlet/subscriptionwebsocket': { target: 'ws://localhost:5500', ws: true },
}
}
} satisfies UserConfig