-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.js
More file actions
62 lines (61 loc) · 1.53 KB
/
Copy pathvite.config.js
File metadata and controls
62 lines (61 loc) · 1.53 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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import pkg from './package.json'
import vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator'
import htmlMinify from 'vite-plugin-html-minify'
export default defineConfig({
define: {
__APP_NAME__: JSON.stringify(pkg.name),
},
base: './',
build: {
outDir: 'docs',
minify: 'terser',
chunkSizeWarningLimit: 800,
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.includes('node_modules')) return 'vendor'
},
chunkFileNames: 'assets/js/[name]-[hash].js',
entryFileNames: 'assets/js/[name]-[hash].js',
assetFileNames: () => {
return 'assets/[ext]/[name]-[hash].[ext]'
}
}
},
terserOptions: {
compress: {
drop_console: false,
drop_debugger: true
}
}
},
plugins: [
vue(),
htmlMinify(),
vitePluginBundleObfuscator({
log: false,
enable: true,
options: {
log: false,
compact: true,
stringArray: true,
renameGlobals: false,
selfDefending: false,
debugProtection: false,
rotateStringArray: true,
deadCodeInjection: false,
stringArrayEncoding: ['none'],
disableConsoleOutput: true,
stringArrayThreshold: 0.75,
controlFlowFlattening: false,
unicodeEscapeSequence: true,
identifierNamesGenerator: 'hexadecimal'
},
autoExcludeNodeModules: true
})],
worker: {
format: 'es'
}
})