-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.ts
50 lines (41 loc) · 998 Bytes
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
import { resolve } from 'path';
import { defineConfig } from 'vite';
import glsl from 'vite-plugin-glsl';
import solid from 'vite-plugin-solid';
import { version } from './package.json';
export default ({ mode }: { mode: string }) =>
defineConfig({
assetsInclude: ['**/*.bin', '**/*.fbx', '**/*.glb', '**/*.gltf'],
resolve: {
conditions: ['development', 'browser'],
alias: {
'@assets': resolve('src/assets'),
'@scss': resolve('src/scss'),
'@': resolve('src')
}
},
define: {
DEBUG: mode !== 'production' && false,
VERSION: JSON.stringify(version)
},
css: {
modules: {
localsConvention: 'camelCaseOnly'
}
},
plugins: [
solid(), glsl({
compress: mode === 'production',
root: '/src/shaders/'
})],
build: {
target: 'esnext',
sourcemap: true
},
server: {
host: '0.0.0.0',
port: 8080,
open: true
},
base: './'
});