generated from iotaledger/template
-
Notifications
You must be signed in to change notification settings - Fork 6
/
vite.config.ts
37 lines (36 loc) · 923 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
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
import { sveltekit } from '@sveltejs/kit/vite'
import { defineConfig, searchForWorkspaceRoot } from 'vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [sveltekit()],
resolve: {
alias: {
process: 'process/browser',
stream: 'stream-browserify',
zlib: 'browserify-zlib',
util: 'util'
}
},
optimizeDeps: {
esbuildOptions: {
// Node.js global to browser globalThis
define: {
global: 'globalThis'
},
// Enable esbuild polyfill plugins
plugins: [
NodeGlobalsPolyfillPlugin({
buffer: true
})
]
}
},
server: {
fs: {
// Allow serving files from one level up to the project root
// source https://vitejs.dev/config/server-options.html#server-fs-allow
allow: ['..'],
},
},
})