1

The real deal is that I’m learning webpack and trying to create my own vue template but I’m getting this issue that not happens in webpack-simple or others templates, and my config for images is pretty similar to what is normally used by templates.

{
    test: /\.(png|jpe?g|gif)$/i,
    use: {
        loader: 'file-loader',
        options: {
            name: '[name].[ext]',
            outputPath: './assets/',
        },
    },
}

I got the following error

http://localhost:8080/[object%20Module] 404 (Not Found)

When I try to get the logo in App.vue

<template>
    <img src="./assets/logo.png"/>
</template>

A fact is that when I use his “dependency” name or hash given by webpack the image is called right.

But the vue docs say that calling as I do has to work as work like in webpack-simple template since the call will be parsed by the webpack.

I don’t know if it helps, but I can import the img from path with import img from './assets/logo.png' just with the HTML in template that I get this problem.

XåpplI'-I0llwlg'I -
  • 21,649
  • 28
  • 102
  • 151
Kaneda
  • 722
  • 5
  • 16

1 Answers1

1

solved with this workaround, just disable esModule in file-loader

https://github.com/vuejs/vue-loader/issues/1612

Kaneda
  • 722
  • 5
  • 16