-
Notifications
You must be signed in to change notification settings - Fork 17
/
vite.config.js
68 lines (49 loc) · 1.75 KB
/
vite.config.js
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
66
import { resolve } from 'path'
import { defineConfig } from 'vite'
export default defineConfig(({ command, mode, ssrBuild }) => {
if (mode === 'production') {
// can change config thusly..
}
return {
root: './src',
base: './',
resolve: {
extensions: ['.js'],
alias: {},
dedupe: [
// This is needed if importing noa-engine from the local filesystem,
// but doesn't hurt anything if you're importing normally.
'@babylonjs/core',
],
},
plugins: [],
server: {
port: 8080,
host: '0.0.0.0',
},
// production build stuff
build: {
target: 'es2020',
outDir: `../docs`, // relative to root, not this file!
emptyOutDir: true, // since build is outside root dir
chunkSizeWarningLimit: 1200, // babylon chunk for these demos is ~1.1MB
minify: true,
rollupOptions: {
// safe to remove all these if you only have one entry point
input: {
index: resolve(__dirname, 'src/index.html'),
test: resolve(__dirname, 'src/test/index.html'),
stress: resolve(__dirname, 'src/stress/index.html'),
helloWorld: resolve(__dirname, 'src/hello-world/index.html'),
},
// remove this if you don't want babylon in its own chunk
manualChunks: (id) => {
if (id.includes('@babylon')) return 'babylon'
},
},
},
// misc
clearScreen: false,
logLevel: 'info',
}
})