Home

Issue: 2595

How to push node setup to webpack config?

[issue link]

So, I’m trying to do this, but got undefind's all the time:

extend (config, ctx) {
  if (ctx.dev && ctx.isClient) {
    config.module.rules.push(
      {
        enforce: 'pre',
        test: /\.(js|vue)$/,
        loader: 'eslint-loader',
        exclude: /(node_modules)/
      },
      {
        test: /\.json$/,
        loader: 'json-loader'
      }
    )
    config.node.push({
      console: 'empty',
      fs: 'empty',
      net: 'empty',
      tls: 'empty'
    })
  }
}

What is wrong? @Atinux @alexchopin @pi0

This question is available on Nuxt.js community (#c2259)