-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
69 lines (67 loc) · 1.7 KB
/
vite.config.ts
File metadata and controls
69 lines (67 loc) · 1.7 KB
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
59
60
61
62
63
64
65
66
67
68
69
import path from 'path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { crx } from '@crxjs/vite-plugin';
import manifest from './manifest.json';
import UnoCSS from 'unocss/vite';
export default defineConfig({
base: './',
resolve: {
alias: {
'@/': `${path.resolve(__dirname, 'src')}/`,
},
},
define: {
'process.env': process.env,
},
server: {
host: 'localhost',
cors: true,
proxy: {
'/dev': {
target: 'http://23.106.133.215:3000',
// target: "http://18.205.246.62:3000",
// target: 'http://localhost:3000',
secure: false,
ws: true,
changeOrigin: true,
rewrite: path => path.replace(/^\/dev/, ''),
},
'/api': {
target: 'http://23.106.133.215:3000',
// target: "http://18.205.246.62:3000",
// target: 'http://localhost:3000',
secure: false,
ws: true,
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, ''),
},
},
},
build: {
// target: 'es2015',
minify: 'terser',
sourcemap: process.env.VITE_APP_ENV === 'develement',
outDir: 'build',
// polyfillModulePreload: true,
commonjsOptions: {
transformMixedEsModules: true,
},
terserOptions: {
compress: {
drop_debugger: true, // 移除 debugger
},
output: {
comments: false, // 去除注释
},
},
rollupOptions: {
// external: ['@walletconnect/jsonrpc-types', '@walletconnect/jsonrpc-utils'],
input: {
main: path.resolve(__dirname, 'index.html'),
},
},
},
plugins: [react(), UnoCSS(), crx({ manifest })],
assetsInclude: ['**/*.ttf'],
});