-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathvite.config.js
More file actions
31 lines (29 loc) · 821 Bytes
/
vite.config.js
File metadata and controls
31 lines (29 loc) · 821 Bytes
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 glsl from 'vite-plugin-glsl'
import topLevelAwait from "vite-plugin-top-level-await";
const isCodeSandbox = 'SANDBOX_URL' in process.env || 'CODESANDBOX_HOST' in process.env
export default {
root: 'src/',
publicDir: '../static/',
base: './',
server:
{
host: true,
open: !isCodeSandbox // Open if it's not a CodeSandbox
},
build:
{
outDir: '../dist',
emptyOutDir: true,
sourcemap: true
},
plugins:
[
glsl(),
topLevelAwait({
// The export name of top-level await promise for each chunk module
promiseExportName: "__tla",
// The function to generate import names of top-level await promise in each chunk module
promiseImportName: i => `__tla_${i}`
})
]
}