generated from geocine/phaser3-rollup-typescript
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
37 lines (34 loc) · 1.03 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
import { defineConfig } from 'vite';
import replace from '@rollup/plugin-replace';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import { splitVendorChunkPlugin } from 'vite'
export default defineConfig({
base:'/phaser-app-ts/',
build: {
chunkSizeWarningLimit: 2000,
rollupOptions: {
output:{
manualChunks(id) {
if (id.includes('node_modules')) {
// return 'vendor';
return id.toString().split('node_modules/')[1].split('/')[0].toString();
}
}
},
plugins: [
splitVendorChunkPlugin(),
nodeResolve(),
// Toggle the booleans here to enable / disable Phaser 3 features:
replace({
preventAssignment: true,
'typeof CANVAS_RENDERER': "'true'",
'typeof WEBGL_RENDERER': "'true'",
'typeof EXPERIMENTAL': "'true'",
'typeof PLUGIN_CAMERA3D': "'false'",
'typeof PLUGIN_FBINSTANT': "'false'",
'typeof FEATURE_SOUND': "'true'"
})
]
}
}
});