1

Image 1 Image 2

{
    test: /\.(jpe?g|gif|png|jpg|svg)$/i,
    use: [
        'file-loader?name=assets/img/[name].[ext]',
        'file-loader?name=assets/icons/[name].[ext]'
        // 'file-loader?name=assets/img/[name].[ext]&outputPath=images/&publicPath=images/'
    ]
  },
  resolve: {

    alias: {
     'images': path.resolve(__dirname, 'src/assets/img'),
     'icons' : path.resolve(__dirname, 'src/assets/icons')
    }
  },

  // in style.scss
  //background: $backgorund;
  //background: url('~icons/earth.png') center center no-repeat;
  background: url('~images/ironman.png') center center no-repeat;
  // background: url('~images/ironman.png') center center no-repeat;
  background: url('~icons/earth.png') center center no-repeat;

In the picture all image insert in image and icons folder, the image should insert correctly (ironman.png in folder image and earth.png in folder icons).

Can anybody help?

Aab
  • 23
  • 5

0 Answers0