I'm trying to convert a Vue 2 component to a standalone component so I can reuse it in other projects.
After some struggling with webpack and POI I managed to get the component working. However the images I use in the component don't work. I want the png or svg images converted to inline base64. I guess I need to work with vue-loader and url-loader in my webpack.config.js but I need some help here!
In my vue component file I have in the template:
<img src="assets/search.png" />
In my webpack.config.js I do
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
use: [
'url-loader?name=assets/[name].[ext]',
{
loader: 'url-loader',
options: {
}
},
],
}
]
},
The img src is not converted. What am I doing wrong?