How to resolve the warning of .svg in VUE without affecting the normal display of icons

the console will report the following warning:
clipboard.png

:

clipboard.png

Mar.20,2021

you have used more loader processing for svg images in the icons folder ( url-loader and svg-loader ). You only need to set the application scope of loader. Refer to

.
{
    test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
    loader: 'url',
    exclude: path.resolve(__dirname, '../src/icons'),
    query: {
       limit: 1000,
       name: utils.assetsPath('img/[name].[ext]')
    }
  },
  {
     test: /\.svg$/,
     include: path.resolve(__dirname, '../src/icons'),
     loader: 'svg-sprite-loader',
     query: {
       symbolId: 'icon-[name]'
     }
  }

this webpack is written in 1.x. You can focus on the exclude and include fields

. The

problem has been found. The code in my esline rule is not properly commented. Let go of the comment, enable esline, or comment out the code:. (config.dev.useEslint? [createLintingRule ()]: []), no problem.

Menu