-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
56 lines (48 loc) · 1.23 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
import { sveltekit } from "@sveltejs/kit/vite";
import inject from '@rollup/plugin-inject';
import { defineConfig } from "vite";
export default defineConfig(({ mode }) => {
return {
plugins: [
sveltekit(),
],
server: {
port: 3000,
fs: {
strict: false
}
},
preview: {
port: 3000
},
// define process.env here to fix dependencies not using import.meta.env instead of deprecated process.env --- based on this fix: https://github.com/vitejs/vite/issues/1973#issuecomment-787571499
define: {
'process.env': {},
},
build : {
target: "es2022",
rollupOptions: {
plugins: [
// Important for wallet adapter to work.
inject({ Buffer: ['buffer', 'Buffer'] })
]
}
},
// esbuild: {
// target: "es2022"
// },
// fix vite build error with esnext - https://github.com/remix-run/remix/issues/7969#issuecomment-1916042039
optimizeDeps: {
esbuildOptions: {
target: "esnext",
},
},
// Important for wallet adapter to work.
// update: not required? solana wallet adapter still works when commented out. when activated and wallet adapter is used in code, it actually causes error 500.
// resolve: {
// alias: {
// path: 'path-browserify',
// },
// },
};
});