Adonis WebSockets Client - How to remove log statements in Nuxt.js

315 views Asked by At

Adonis js v4

I saw here that I should defining NODE_ENV via Webpack DefinePlugin or rollup-plugin-replace

"@adonisjs/websocket-client": "^1.0.9"

and I did that but nothing changed, when I build the nuxt project and then nuxt start

here is my nuxt.config.js

import colors from 'vuetify/es5/util/colors'
require('dotenv').config()
import webpack from 'webpack'

export default {
  ...

  build: {
   ...

   plugins: [
      new webpack.DefinePlugin({
        'NODE_ENV': 'production'
      })
    ]
  }
  ...
}

1

There are 1 answers

1
frost kazuma On BEST ANSWER

The fix to this is to add a /index when importing the package in a component, which is kinda weird but cant see any solution to this.

It would look like this now: import Ws from '@adonisjs/websocket-client/index'