forked from district53/d53launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
36 lines (33 loc) · 958 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
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from "vite";
import { NodeGlobalsPolyfillPlugin } from "@esbuild-plugins/node-globals-polyfill";
import nodePolyfills from "rollup-plugin-node-polyfills";
export default defineConfig({
plugins: [sveltekit()],
resolve: {
alias: {
stream: "rollup-plugin-node-polyfills/polyfills/stream",
events: "rollup-plugin-node-polyfills/polyfills/events",
assert: "rollup-plugin-node-polyfills/polyfills/assert",
assert2: "rollup-plugin-node-polyfills/polyfills/assert",
buffer: "rollup-plugin-node-polyfills/polyfills/buffer-es6",
crypto: "crypto-browserify",
util: "util",
},
},
define: {
"process.env": process.env ?? {},
},
build: {
target: "es2020",
rollupOptions: {
plugins: [nodePolyfills({ crypto: true })],
},
},
optimizeDeps: {
esbuildOptions: {
plugins: [NodeGlobalsPolyfillPlugin({ buffer: true })],
target: "es2020",
},
},
});