After Vue-cli is packaged, the picture is always loaded from the root directory of the server.

pictures are always loaded from the root directory of the server

clipboard.png

clipboard.png

I don"t know where

was omitted when packing.
Mar.16,2021

  1. check the path configuration in config;
  2. if you can't solve it, use the absolute address, just use the address of the image resource uploaded to the server.

{
  test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
  loader: 'url-loader',
  options: {
     limit: 10000,
     name: utils.assetsPath('img/[name].[hash:7].[ext]'),
     outputPath: process.env.NODE_ENV === 'production' ? '../' : ''
    }
 },

you can try to modify outputPath: process.env.NODE_ENV = 'production'?'.. /':'


problem solved. Mainly my pictures were placed in this static directory

.

clipboard.png

clipboard.png
src/assets webpack

clipboard.png

Menu