This repository has been archived by the owner on Mar 17, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 158
Add ability to set encodings #25
Comments
IE has issues with Base64 encoded data URIs, so I'm having problems related to this also. But I'm not sure it even needs to be as complicated as you suggest. A simple option to toggle using URL-encoded plaintext instead of Base64 encoding should be sufficient. Those are the only valid way to encode data URIs anyway (see http://codepen.io/tigt/post/optimizing-svgs-in-data-uris). Then you could just do something like:
|
@joekrill good suggestion |
michael-ciniawsky
changed the title
Add ability to specify mimetype-specific encoding strategy
feat: add ability to set encodings
Apr 9, 2017
#28 needs to be reworked (WIP) |
michael-ciniawsky
changed the title
feat: add ability to set encodings
Add ability to set encodings
Jun 10, 2017
alexander-akait
added
priority: 5 (nice to have)
semver: Minor
severity: 4 (inconvenient)
and removed
flag: Has pull request
labels
Jun 5, 2019
6 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi @sokra!
Thanks for the great loader.
Default loader behaviour is to encode source and return Data URI. But for SVG is no necessary to encode source in base64, because it works with raw content encoded with encodeURIComponent. Moreover it will decrease ~30% of content length and save browser resources for unpacking base64 string. My suggestion is to add user defined handlers to specific mime-type, something like this:
For backward compatibility option can be disabled by default. For details please take a look at my advanced-url-loader which based on url-loader. I can make a PR, if you agree. Also I want be a volunteer and cover all existing loader code with tests. And close some issues.
The text was updated successfully, but these errors were encountered: