Handle asset URLs in Vue SFC templates
When Vue Loader compiles <template> blocks in Single File Components (SFCs), it converts asset URLs into webpack module requests (using require()). This allows webpack to process assets via loaders like file-loader or url-loader for version hashing and caching.
By default, the following tag and attribute combinations are transformed:
video:src,postersource:srcimg:srcimage:xlink:href,hrefuse:xlink:href,href
These defaults can be customized using the transformAssetUrls option.
<!-- Input -->
<img src="../image.png">
<!-- Compiled Output -->
createElement('img', {
attrs: {
src: require('../image.png')
}
})