Home > Back-end >  How to disable eslint overlay in latest Vue?
How to disable eslint overlay in latest Vue?

Time:04-05

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

CodePudding user response:

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,
    }
  }
})
  • Related