-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvite.config.js
49 lines (47 loc) · 1.45 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
// eslint-disable-next-line import/no-unresolved
import { fileURLToPath, URL } from 'node:url';
import { polyfillNode } from 'esbuild-plugin-polyfill-node';
import rollupNodePolyFill from 'rollup-plugin-node-polyfills';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
// https://vitejs.dev/config/
export default defineConfig({
// base: '/WakfuWizard/',
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
util: 'rollup-plugin-node-polyfills/polyfills/util',
string_decoder: 'rollup-plugin-node-polyfills/polyfills/string-decoder',
events: 'rollup-plugin-node-polyfills/polyfills/events',
stream: 'rollup-plugin-node-polyfills/polyfills/stream',
zlib: 'rollup-plugin-node-polyfills/polyfills/zlib',
_stream_transform: 'rollup-plugin-node-polyfills/polyfills/readable-stream/transform',
process: 'rollup-plugin-node-polyfills/polyfills/process-es6',
},
},
optimizeDeps: {
esbuildOptions: {
// Node.js global to browser globalThis
define: {
global: 'globalThis',
},
// Enable esbuild polyfill plugins
plugins: [
polyfillNode({
// process: true,
// buffer: true,
}),
],
},
},
build: {
rollupOptions: {
plugins: [
// Enable rollup polyfills plugin
// used during production bundling
rollupNodePolyFill(),
],
},
},
});