-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
58 lines (54 loc) · 1.27 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve, dirname } from 'node:path'
import { fileURLToPath } from 'url'
import dotenv from 'dotenv'
import vueJsx from '@vitejs/plugin-vue-jsx'
import { visualizer } from 'rollup-plugin-visualizer'
import svgLoader from 'vite-svg-loader'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import { chunkSplitPlugin } from 'vite-plugin-chunk-split'
dotenv.config()
// const builtinsPlugin = builtins({crypto: true});
// builtinsPlugin.name = 'builtins';
export default defineConfig({
server: {
port: 3000,
},
plugins: [
// splitVendorChunkPlugin(),
vue(),
vueJsx(),
svgLoader(),
visualizer(),
VueI18nPlugin({
include: [resolve(__dirname, './src/i18n/locales/**')],
}),
chunkSplitPlugin({
strategy: 'all-in-one',
customSplitting: {
wasm: [/vm-exec.source.ts/],
},
}),
],
resolve: {
alias: {
'@': resolve(__dirname, './src'),
'~': resolve(__dirname, './src'),
},
},
build: {
target: 'es2020',
},
optimizeDeps: {
include: ['bn.js'],
esbuildOptions: {
target: 'esnext',
},
},
define: {
// 'process.env': {},
// 'process.env': process.env,
},
// rollupOptions: {},
})