简体   繁体   中英

How to restore console alerts in uglifyJsPlugin

Do anybody know how to turn back on console log and alerts in Adminator (webpack based, link below). Have tried to turn off each plugin one by one, both production and development mode, unsuccessfully.

I assume that uglifyJsPlugin is responsible, but even changing compress parameters to false didn't work.

https://github.com/puikinsh/Adminator-admin-dashboard

in webpack.config.js

// ---------------------------
// @Merging Production Plugins
// ---------------------------

if (manifest.IS_PRODUCTION) {
  plugins.push(
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        comparisons   : true,
        conditionals  : true,
        dead_code     : false,
        drop_debugger : false,
        evaluate      : true,
        if_return     : true,
        join_vars     : true,
        screw_ie8     : true,
        sequences     : true,
        unused        : true,
        warnings      : false,
      },

      output: {
        comments: false,
      },
    })
  );
}

Can you please disable drop_console attribute to false and check with below config.

Reference : compress-options

// ---------------------------
// @Merging Production Plugins
// ---------------------------

if (manifest.IS_PRODUCTION) {
  plugins.push(
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        comparisons   : true,
        conditionals  : true,
        dead_code     : false,
        drop_debugger : false,
        evaluate      : true,
        if_return     : true,
        join_vars     : true,
        screw_ie8     : true,
        sequences     : true,
        unused        : true,
        warnings      : false,
        drop_console  : false
      },

      output: {
        comments: false,
      },
    })
  );
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM