-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
40 lines (38 loc) · 1.3 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
import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import glsl from 'vite-plugin-glsl';
export default defineConfig({
base: "/three_vite",
clearScreen: false,
optimizeDeps: {
esbuildOptions: {
supported: {
'top-level-await': true
}
}
},
esbuild: {
supported: {
'top-level-await': true
}
},
build: {
sourcemap: true,
},
server: {
open: true
},
plugins: [
viteStaticCopy({
targets: [
{ src: 'node_modules/three/examples/jsm/libs/ammo.wasm.js', dest: 'jsm/libs/' },
{ src: 'node_modules/three/examples/jsm/libs/ammo.wasm.wasm', dest: 'jsm/libs/' },
{ src: 'node_modules/three/examples/jsm/libs/draco/gltf/draco_decoder.js', dest: 'jsm/libs/draco/gltf' },
{ src: 'node_modules/three/examples/jsm/libs/draco/gltf/draco_decoder.wasm', dest: 'jsm/libs/draco/gltf/' },
{ src: 'node_modules/three/examples/jsm/libs/draco/gltf/draco_encoder.js', dest: 'jsm/libs/draco/gltf/' },
{ src: 'node_modules/three/examples/jsm/libs/draco/gltf/draco_wasm_wrapper.js', dest: 'jsm/libs/draco/gltf/' }
]
}),
glsl()
]
})