feat(frontend): 增加一点混淆
This commit is contained in:
@@ -1,18 +1,41 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import obfuscatorPlugin from "vite-plugin-javascript-obfuscator";
|
||||
import { resolve } from 'path'
|
||||
|
||||
export default defineConfig(({ comand, mode }) => {
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
return {
|
||||
build: {
|
||||
target: 'modules',
|
||||
sourcemap: false,
|
||||
rollupOptions: {
|
||||
input: {
|
||||
entrence: resolve(__dirname, 'index.html'),
|
||||
entrance: resolve(__dirname, 'index.html'),
|
||||
index: resolve(__dirname, 'pages/index/index.html'),
|
||||
login: resolve(__dirname, 'pages/login/index.html'),
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
obfuscatorPlugin({
|
||||
options: {
|
||||
compact: true,
|
||||
controlFlowFlattening: true,
|
||||
controlFlowFlatteningThreshold: 0.75,
|
||||
deadCodeInjection: true,
|
||||
deadCodeInjectionThreshold: 0.4,
|
||||
debugProtection: false,
|
||||
disableConsoleOutput: true,
|
||||
identifierNamesGenerator: 'hexadecimal',
|
||||
renameGlobals: false,
|
||||
stringArrayRotate: true,
|
||||
selfDefending: true,
|
||||
stringArray: true,
|
||||
stringArrayEncoding: ['base64'],
|
||||
stringArrayThreshold: 0.75,
|
||||
transformObjectKeys: true,
|
||||
unicodeEscapeSequence: false,
|
||||
}
|
||||
})
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user