How to configure image-webpack-loader? in vue-cli3

image-webpack-loader was previously configured in webpack.base.config.js:

{
  test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
  use:[
    {
    loader: "url-loader",
    options: {
      limit: 10000,
      name: utils.assetsPath("img/[name].[hash:7].[ext]")
      }
    },
    {
      loader: "image-webpack-loader",
      options: {
        bypassOnDebug: true,
      }
    }
  ]
}

there is no local configuration for using vue-cli3. It is configured in vue-config.js on the official website, but how should it be configured? Have you ever used it?

Aug.30,2021

landlord, hello ~
try this one below, you can test it yourself. Finally, you can verify

with the command vue-cli-service inspect .
   

the transformation of the first question, you can see that the path of the final img output is not processed. See if there are any other changes

. < hr >

if it is helpful, please click to adopt it, thank you ~

Menu