forked from Real-Currents/webxr-start
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
58 lines (57 loc) · 1.78 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
52
53
54
55
56
57
58
import { NodeGlobalsPolyfillPlugin } from "@esbuild-plugins/node-globals-polyfill";
import { NodeModulesPolyfillPlugin } from "@esbuild-plugins/node-modules-polyfill";
import basicSsl from "@vitejs/plugin-basic-ssl";
import shader from 'rollup-plugin-shader';
export default {
base: "",
define: {
// "process.env.MapboxAccessToken": JSON.stringify(process.env.MapboxAccessToken)
},
optimizeDeps: {
esbuildOptions: {
plugins: [
NodeGlobalsPolyfillPlugin({
process: true,
buffer: true
}),
NodeModulesPolyfillPlugin()
]
}
},
resolve: {
alias: [
// {
// find: "@", replacement: resolve(__dirname, "./src"),
// },
{
find: "./runtimeConfig", replacement: "./runtimeConfig.browser"
},
{
find: "util",
replacement: "rollup-plugin-node-polyfills/polyfills/util"
}
]
},
server: { https: true }, // Not needed for Vite 5+
plugins: [
basicSsl({
/** name of certification */
name: 'test',
// /** custom trust domains */
// domains: ['*.custom.com'],
// /** custom certification directory */
// certDir: '/Users/.../.devServer/cert'
}),
shader({
// All match files will be parsed by default,
// but you can also specifically include/exclude files
include: [
'**/*.glsl',
'**/*.vs',
'**/*.fs'
],
// specify whether to remove comments
removeComments: true, // default: true
})
]
};