增加代码混淆

This commit is contained in:
2025-03-06 17:14:27 +08:00
parent 08ce1ab900
commit 80bcb1f20d
4 changed files with 767 additions and 4 deletions

View File

@@ -1,7 +1,31 @@
import { defineConfig } from 'vite'
import {defineConfig} from 'vite'
import obfuscatorPlugin from "vite-plugin-javascript-obfuscator";
import vue from '@vitejs/plugin-vue'
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
plugins: [
vue(),
obfuscatorPlugin({
apply: config => config['mode'] === 'production',
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,
}
})
],
})