-
Notifications
You must be signed in to change notification settings - Fork 8
/
vite.config.js
42 lines (40 loc) · 986 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
32
33
34
35
36
37
38
39
40
41
42
import { defineConfig } from 'vite';
const entries = ['./lib/main.ts'];
export default defineConfig({
optimizeDeps: {
include: ['three'], // optionally specify dependency name
esbuildOptions: {
supported: {
'top-level-await': true,
},
},
},
resolve: {
alias: {
'three/ShaderChunk': 'three/examples/jsm/shaders/ShaderChunk',
'three/UniformsLib': 'three/examples/jsm/shaders/UniformsLib',
'three/webgpu': 'three',
'three/addons': 'three/examples/jsm',
'three/tsl': 'three/webgpu',
three: 'three/webgpu',
},
},
build: {
minify: false,
sourcemap: true,
target: 'es2018',
lib: {
formats: ['es', 'cjs'],
entry: entries[0],
fileName: '[name]',
},
rollupOptions: {
treeshake: false,
output: {
preserveModules: true, // false for threejs module
preserveModulesRoot: 'src',
sourcemapExcludeSources: true,
},
},
},
});