I'm using "file-loader": "^6.2.0" in my Vue.js project, and I try to load PNG images from my assets directory using <img :src="require('@/assets/images/image.png')">
When image.png is < 4KB it works as expected, but when when it's > 4KB I get a response of [object Module], and I have to add .default (require('@/assets/images/image.png').default). It's not ideal cause sometimes I don't know the file size in advance, and I also prefer consistent usage "style".
I tried to fix it with suggestions I found here , but when I add the esModule: false option I get invalid base64 image string(shorter than what I got for images < 4KB before adding the options).
Any suggestion how it can be fixed?