forked from micahscopes/webscape-wanderer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
51 lines (48 loc) · 1.08 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
40
41
42
43
44
45
46
47
48
49
50
51
import topLevelAwait from "vite-plugin-top-level-await";
import { defineConfig } from 'vite'
// import { nodePolyfills } from 'vite-plugin-node-polyfills'
import glsl from 'vite-plugin-glsl';
import wasm from "vite-plugin-wasm";
// import ObjFileImport from 'unplugin-obj/vite';
const plugins = [
topLevelAwait({
promiseExportName: "__tla",
promiseImportName: i => `__tla_${i}`
}),
glsl(),
wasm(),
// ObjFileImport(),
//nodePolyfills({
// protocolImports: true,
//}),
]
export default defineConfig({
target: "es6",
plugins,
worker: {
format: "es",
plugins
},
base: "/webscape-wanderer/",
assetsInclude: [
'**/*.obj'
],
optimizeDeps: {
esbuildOptions: {
// Node.js global to browser globalThis
define: {
global: 'globalThis',
},
},
include: [
// necessary because gpu-io only builds a UMD module
"gpu-io"
]
},
server: {
fs: {
allow: ['../router', '../gpu-io', '.'],
},
},
//base: "./", // this relies on `import.meta`, which doesn't work in workers on firefox/webkit
});