forked from mark3labs/louper-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
40 lines (38 loc) · 957 Bytes
/
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
import { sveltekit } from '@sveltejs/kit/vite'
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill'
import rollupNodePolyFill from 'rollup-plugin-node-polyfills'
/** @type {import('vite').UserConfig} */
const config = {
resolve: {
alias: {
events: 'rollup-plugin-node-polyfills/polyfills/events',
buffer: 'rollup-plugin-node-polyfills/polyfills/buffer-es6',
},
},
plugins: [sveltekit()],
server: {
port: 3000,
},
optimizeDeps: {
esbuildOptions: {
target: 'es2020',
define: {
global: 'globalThis',
},
plugins: [
NodeGlobalsPolyfillPlugin({
buffer: true,
}),
NodeModulesPolyfillPlugin(),
],
},
},
build: {
target: 'es2020',
rollupOptions: {
plugins: [rollupNodePolyFill()],
},
},
}
export default config