Tallboy
Tallboy

Reputation: 13467

How to disable eslint overlay in latest Vue?

I used to have this in vue.config.js but it no longer works after latest upgrade of vue or its deps:

chainWebpack: config => {
  // disable eslint nag screen when building for different environments
  if (!isProduction) config.module.rules.delete('eslint');
}

There is a part of the docs of vue-cli that says I can do this:

  devServer: {
    overlay: {
      warnings: false,
      errors: false
    },

But it says overlay is not a valid option

Upvotes: 5

Views: 5546

Answers (1)

tony19
tony19

Reputation: 138686

Vue CLI 5 uses Webpack 5, which has moved devServer.overlay to devServer.client.overlay:

// vue.config.js
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  devServer: {
    client: {
      overlay: {
        warnings: false,
        errors: false,
      },

      // or
      overlay: false,
    }
  }
})

Upvotes: 13

Related Questions