1
0

feat: 前端生产构建添加代码混淆

- 集成 vite-plugin-javascript-obfuscator 插件
- 配置中等偏高强度混淆策略(变量名、字符串、对象键、数字)
- 仅生产构建时启用,不影响开发体验
- 仅混淆业务代码,排除第三方库
- 不生成 Source Map
- 新增 frontend-obfuscation 规范
This commit is contained in:
2026-04-23 18:23:07 +08:00
parent e0d05c9869
commit 0a92a25451
5 changed files with 326 additions and 11 deletions

View File

@@ -42,6 +42,7 @@
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.4.0",
"happy-dom": "^20.9.0",
"javascript-obfuscator": "^5.4.1",
"jsdom": "^26.1.0",
"msw": "^2.8.2",
"sass": "^1.99.0",
@@ -49,6 +50,7 @@
"typescript": "~6.0.2",
"typescript-eslint": "^8.58.0",
"vite": "^8.0.4",
"vite-plugin-javascript-obfuscator": "^3.1.0",
"vitest": "^3.2.1"
}
}