✨ 混淆前端打包后代码

This commit is contained in:
sugarBecomer
2026-03-27 16:37:14 +08:00
parent 0681aad27d
commit 5729e88687
2 changed files with 43 additions and 1 deletions
+1
View File
@@ -39,6 +39,7 @@
"tw-animate-css": "^1.4.0", "tw-animate-css": "^1.4.0",
"typescript": "~5.9.3", "typescript": "~5.9.3",
"vite": "^8.0.1", "vite": "^8.0.1",
"vite-plugin-bundle-obfuscator": "^1.11.0",
"vue-tsc": "^3.2.5" "vue-tsc": "^3.2.5"
} }
} }
+42 -1
View File
@@ -2,9 +2,50 @@ import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
import tailwindcss from '@tailwindcss/vite' import tailwindcss from '@tailwindcss/vite'
import { fileURLToPath, URL } from 'node:url' import { fileURLToPath, URL } from 'node:url'
import vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator'
export default defineConfig({ export default defineConfig({
plugins: [vue(), tailwindcss()], plugins: [
vue(),
tailwindcss(),
vitePluginBundleObfuscator({
apply: 'build',
log: true,
autoExcludeNodeModules: true,
threadPool: true,
options: {
compact: true,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 1,
deadCodeInjection: false,
debugProtection: false,
debugProtectionInterval: 0,
disableConsoleOutput: true,
identifierNamesGenerator: 'hexadecimal',
ignoreImports: true,
numbersToExpressions: true,
renameGlobals: false,
selfDefending: true,
simplify: true,
splitStrings: true,
splitStringsChunkLength: 5,
stringArray: true,
stringArrayCallsTransform: true,
stringArrayCallsTransformThreshold: 1,
stringArrayEncoding: ['base64'],
stringArrayIndexShift: true,
stringArrayRotate: true,
stringArrayShuffle: true,
stringArrayWrappersChainedCalls: true,
stringArrayWrappersCount: 3,
stringArrayWrappersParametersMaxCount: 4,
stringArrayWrappersType: 'function',
stringArrayThreshold: 1,
transformObjectKeys: true,
unicodeEscapeSequence: false,
},
}),
],
resolve: { resolve: {
alias: { alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)) '@': fileURLToPath(new URL('./src', import.meta.url))