-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
31 lines (30 loc) · 928 Bytes
/
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
import { defineConfig } from 'vite';
import glsl from 'vite-plugin-glsl';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
/** @type {import('vite').UserConfig} */
return {
// config options
assetsInclude: ['**/*.gltf', '**/*.glb'],
plugins: [glsl({ compress: mode === 'production' ? true : false })],
build: {
target: ['es2022'],
chunkSizeWarningLimit: 600,
rollupOptions: {
output: {
// chunking and dependency size observability
manualChunks: (id) => {
// create chunk for three deps.
if (id.includes('node_modules/three') || id.includes('@three')) {
return 'three';
}
// create chunk for tweakpane deps.
if (id.includes('tweakpane') || id.includes('@tweakpane')) {
return 'tweakpane';
}
}
}
}
}
};
});