-
Notifications
You must be signed in to change notification settings - Fork 26
/
vite.config.ts
65 lines (62 loc) · 1.23 KB
/
vite.config.ts
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
60
61
62
63
64
65
import { defineConfig, /* splitVendorChunkPlugin */ } from 'vite';
import react from '@vitejs/plugin-react';
import eslint from 'vite-plugin-eslint';
import viteTsconfigPaths from 'vite-tsconfig-paths';
import basicSsl from '@vitejs/plugin-basic-ssl';
import { visualizer } from "rollup-plugin-visualizer";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react({ babel: { parserOpts: {} } }),
eslint(),
viteTsconfigPaths(),
basicSsl(),
/* splitVendorChunkPlugin(),
*/ visualizer({
emitFile: false,
filename: "stats.html",
})
],
server: {
https: true,
port: 4443,
host: true,
hmr: {
path: '/vite/'
}
},
resolve: {
alias: {
'webtorrent': 'webtorrent/dist/webtorrent.min.js',
},
},
build: {
rollupOptions: {
output: {
manualChunks(id: string) {
if (
id.includes('ortc-p2p')
) {
return '@ortc-p2p';
}
if (
id.includes('material-react-table/dist/index.esm.js')
) {
return 'material-react-table/dist/index.esm.js';
}
if (
id.includes('x-date-pickers')
) {
return 'x-date-pickers';
}
if (
id.includes('@mui')
) {
return '@mui';
}
},
},
},
outDir: 'build',
},
});