forked from shuaiplus/nodecrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
95 lines (95 loc) · 1.77 KB
/
vite.config.js
File metadata and controls
95 lines (95 loc) · 1.77 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import {
defineConfig
} from 'vite';
export default defineConfig({
// Root directory
// 根目录
root: 'client',
// Base URL
// 基础 URL
base: './',
// Plugins
// 插件
plugins: [],
// Build options
// 构建选项
build: {
// Output directory
// 输出目录
outDir: '../dist',
// Empty output directory
// 清空输出目录
emptyOutDir: true,
// Minify
// 压缩
minify: 'terser',
// Terser options
// Terser 选项
terserOptions: {
compress: {
// Drop console statements
// 删除 console 语句
drop_console: false,
// Drop debugger statements
// 删除 debugger 语句
drop_debugger: false
}
},
// Rollup options
// Rollup 选项
rollupOptions: { // Input file
// 输入文件
input: 'client/index.html',
// Output options
// 输出选项
output: {
// Manual chunks
// 手动分块
manualChunks: (id) => {
if (id.includes('node_modules')) {
if (/aes-js|elliptic|js-chacha20|js-sha256/.test(id)) {
return 'crypto-libs'
}
return 'vendor-deps'
}
return undefined
},
},
},
// Sourcemap
// Sourcemap
sourcemap: false,
// CSS code split
// CSS 代码分割
cssCodeSplit: true,
// Chunk size warning limit
// 代码块大小警告限制
chunkSizeWarningLimit: 1000,
},
// Resolve options
// 解析选项
resolve: {
// Alias
// 别名
alias: {
buffer: 'buffer',
},
},
// Server options
// 服务器选项
server: {
// HMR
// 热模块替换
hmr: true,
// Open browser
// 打开浏览器
open: true,
},
// Optimize dependencies
// 优化依赖
optimizeDeps: {
// Include
// 包含
include: ['buffer', 'aes-js', 'elliptic', 'js-chacha20', 'js-sha256', '@dicebear/core', '@dicebear/micah'],
},
});