Disable websocket client console logs /w vue


I tried to disable websocket logs at client as written here: https://adonisjs.com/docs/4.1/websocket-client#_production_builds

But I didn’t succeed despite many attempts.
Here are the details:

"@vue/cli-service": "^3.0.5",
"@adonisjs/websocket-client": "^1.0.9",
"vue": "^2.5.17",

Here are my attemps:

// vue.config.js
const webpack = require('webpack');
module.exports = {
  configureWebpack: {
    plugins: [
      new webpack.DefinePlugin({
        PRODUCTION: JSON.stringify(true),
        'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
        'NODE_ENV': '"production"',
  chainWebpack: config => {
    config.plugin('define').tap(definitions => {
      definitions[0] = Object.assign(definitions[0], {
        'process.env.NODE_ENV': '"production"',
        'NODE_ENV': '"production"',
        PRODUCTION: JSON.stringify(true),
      return definitions

Any idea, any help? Thanks


You are using the value process.env.NODE_ENV which is only set when you run your webpack build by setting it to something. Can you share the script you run to execute webpack build?


Thanks for answer!
I just use vue-cli v3.0.5 . As mentioned here, vue cli v3 comes with webpack included. I attached my vue.config.js and package.json file at the post above.

The issue seems about webpack with vue, not just webpack. :slight_smile: