企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
一、打包去除所有console.log 和注释 ``` 具体配置如下: ``` ``` new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false, dead_code: true, // 去除不可达代码(不会运行的代码) pure_funcs: ['console.log'], // 配置发布时,不被打包的函数 drop_debugger: true, // 发布时去除debugger // drop_console: true // 发布时去除console }, output: { // 去掉注释内容 comments: false, }, }), ```