electron-vue打包后的項目控制台沒有日志的解決辦法


在 .electron-vue 目錄下有一個配置文件 webpack.renderer.config.js

修改 webpack.renderer.config.js 這個配置文件

rendererConfig.optimization = {
    minimizer: [
      new TerserPlugin({
        test: /\.js(\?.*)?$/i,
        extractComments: false,
        cache: false,
        sourceMap: false,
        terserOptions: {
          warnings: false,
          compress: { //壓縮
            //warnings: false, // 修改后
            //drop_console: false, // 修改后
            //drop_debugger: false, // 修改后
            //pure_funcs: ['console.log'] // 修改后
          },
        }
      })]


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM