http-vue-loader
http-vue-loader copied to clipboard
Either source string as input or at least work with data-URIs
Would it be possible to get the constructor to take a inline sourced string as input, instead of requiring a URL? (maybe with a base path for any images or whatever the template might refer to)
Alternatively I tried passing the source as a data-uri string, but then I get an error: httpVueLoader.js:453 GET data:text/plain;base64,xxxxxxxxx/index.vue net::ERR_INVALID_URL
(apparently it tries to append /index.vue
)
(I also tried writing a custom httpVueLoader.httpRequest
to intercept data: urls and just return a Promise with the decoded body, but then I run into another issue: 'data' URLs may not be used as base URLs for a document.
)
@sp00x There is a function that parses and decomposes the url called parseComponentURL
. That's where /index.vue
is appended. maybe you can modify it to handle data-uris as well as blob urls.
I made a pull request to support it: #112 This supports string input, inline element and data-URLs.