-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
41 lines (38 loc) · 902 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
38
39
40
41
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';
import { searchForWorkspaceRoot } from 'vite';
import inject from '@rollup/plugin-inject';
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill';
export default defineConfig({
plugins: [sveltekit()],
resolve: {
alias: {
buffer: 'buffer',
crypto: 'crypto-browserify',
stream: 'stream-browserify',
http: 'stream-http',
https: 'https-browserify',
url: 'url'
}
},
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
},
build: {
target: 'es2020',
rollupOptions: {
plugins: [inject({ Buffer: ['buffer', 'Buffer'] })]
}
},
optimizeDeps: {
esbuildOptions: {
plugins: [NodeGlobalsPolyfillPlugin({ buffer: true })],
target: 'es2020'
}
},
server: {
fs: {
allow: [searchForWorkspaceRoot(process.cwd()), 'static/images/']
}
}
});