You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-6Lines changed: 15 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,11 @@
3
3
4
4
A webpack loader which loads SVG file as utf-8 encoded DataUrl string.
5
5
6
-
Existing [`url-loader`](https://github.com/webpack-contrib/url-loader) always does Base64 encoding for data-uri. As SVG content is a human-readable xml string, using base64 encoding is not mandatory. Instead, one may only escape [unsafe characters](http://www.ietf.org/rfc/rfc1738.txt) and replace `"` with `'` as described [in this article](http://codepen.io/Tigt/post/optimizing-svgs-in-data-uris).
6
+
Existing [`url-loader`](https://github.com/webpack-contrib/url-loader) always does Base64 encoding for data-uri. As SVG content is a human-readable xml string, using base64 encoding is not mandatory. Instead, one may only escape [unsafe characters](http://www.ietf.org/rfc/rfc1738.txt) and replace `"` with `'` as described [in this article](http://codepen.io/Tigt/post/optimizing-svgs-in-data-uris).
7
7
8
-
There are some benefits for choosing utf-8 encoding over base64.
9
-
1. Resulting string is shorter (can be ~2 times shorter for 2K-sized icons);
10
-
2. Resulting string will be compressed better when using gzip compression;
8
+
There are some benefits for choosing utf-8 encoding over base64.
9
+
1. Resulting string is shorter (can be ~2 times shorter for 2K-sized icons);
10
+
2. Resulting string will be compressed better when using gzip compression;
11
11
3. Browser parses utf-8 encoded string faster than its base64 equivalent.
12
12
13
13
## Supported parameters
@@ -23,8 +23,8 @@ Passing this parameter (or setting to `true`) tells to loader *not to include* r
23
23
24
24
### `limit`
25
25
26
-
If given will tell the loader not to encode the source file if its content is greater than this limit.
27
-
Defaults to no limit.
26
+
If given will tell the loader not to encode the source file if its content is greater than this limit.
27
+
Defaults to no limit.
28
28
If the file is greater than the limit the [`file-loader`](https://github.com/webpack-contrib/file-loader) is used and all query parameters are passed to it.
0 commit comments