-
Notifications
You must be signed in to change notification settings - Fork 4
/
vite.config.ts
45 lines (37 loc) · 955 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
import { resolve } from 'path';
import { defineConfig } from 'vite';
import glsl from 'vite-plugin-glsl';
import { version } from './package.json';
import { svelte } from '@sveltejs/vite-plugin-svelte';
export default ({ mode }: { mode: string }) => defineConfig({
assetsInclude: ['**/*.bin', '**/*.fbx', '**/*.glb', '**/*.gltf'],
resolve: {
conditions: ['development', 'browser'],
alias: { '@': resolve('src') }
},
define: {
DEBUG: mode !== 'production' && false,
TEST: mode !== 'production' && false,
PRODUCTION: mode === 'production',
BUILD: JSON.stringify(version),
STAGING: !!process.env.prod
},
plugins: [
svelte(),
mode !== 'production' && glsl({
root: '/src/shaders/',
include: [
'**/*.vert',
'**/*.frag',
'**/*.glsl'
]
})
],
build: { target: 'esnext' },
server: {
host: '0.0.0.0',
port: 8080,
open: true
},
base: './'
});