## vue2.6 + vue-cli3 构建代码混淆 webpack-obfuscator git地址:https://github.com/javascript-obfuscator/webpack-obfuscator ### vue.config.js文件 ![](https://img.kancloud.cn/43/4b/434bacaeca9914c6c4aa4a472944ab6d_1220x2164.png) *** ### 版本兼容 ![](https://img.kancloud.cn/a9/20/a920946fb3ff919edd3991ce42335c26_853x137.png) > webpack4最高使用版本`webpack-obfuscator@2.6.0` ### 找不到模块 ![](https://img.kancloud.cn/3a/2e/3a2e03dbfbfe68933df3f72ef0204c29_809x115.png) > Javascript-obfuscator是对等依赖,所以必须手动安装 > https://www.npmjs.com/package/javascript-obfuscator ### package.json文件 ``` "terser-webpack-plugin": "^4.2.3" // 压缩代码 "webpack-obfuscator": "^2.6.0" // 混淆 "javascript-obfuscator": "^2.19.0" ``` ### 参考文章:https://www.cnblogs.com/dragonir/p/14445767.html