Skip to content

Commit e73c73d

Browse files
committed
feat: 4.19.0-beta.2
1 parent 58a44f4 commit e73c73d

6 files changed

Lines changed: 134 additions & 142 deletions

File tree

CHANGELOG.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,42 @@
22

33
## 4.19.0-beta.0
44

5-
### BREAKING CHANGES by inlining SVG only
5+
### 🔥 BREAKING CHANGES by inlining SVG only
66

77
- Inline `<img src="icon.svg">`:
88
- OLD: replaces `<img>` with `<svg>` tag
9-
- NEW: inlines SVG as escaped data URL
9+
- NEW: inlines SVG as base64-encoded data URL. Use new `svg.inline.embed = true` option to keep old behaviour.
1010
- Encoding of data URL:
1111
- OLD: defaults, escaped URL (`#%` chars only), e.g. `data:image/svg+xml,<svg>...</svg>`
12-
- NEW: defaults, base64 encoded, e.g. `data:image/svg+xml;base64,iVBO` or full escaped URL, e.g. `data:image/svg+xml,%3Csvg%20` regards `generator.dataUrl.encoding` option
12+
- NEW: defaults, base64 encoded, e.g. `data:image/svg+xml;base64,iVBO` or full escaped URL, e.g. `data:image/svg+xml,%3Csvg%20` regards `generator.dataUrl.encoding` option.
13+
14+
15+
### ✨ Feature
16+
17+
New `svg` plugin option:
18+
19+
```ts
20+
type SvgOptions = {
21+
enabled?: boolean;
22+
// RegEx to match SVG files.
23+
// Defaults `/\.svg/i`.
24+
test?: RegExp;
25+
inline?: {
26+
// Enable inline SVG by replacing <img> with <svg>, only in HTML.
27+
// Equivalent to query: `?inline=embed` | `?embed`.
28+
// Defaults `false`.
29+
embed?: boolean;
30+
// Data URL encoding, overrides `generator.dataUrl.encoding` option.
31+
// Equivalent to query: `?inline=base64` | `?inline=escape`.
32+
// Defaults the `generator.dataUrl.encoding` option, if undefined then `base64`.
33+
encoding?: 'base64' | false;
34+
};
35+
};
36+
```
37+
38+
### Bugfix
39+
40+
Consider `generator.dataUrl()` and `generator.dataUrl.encoding` Webpack options.
1341

1442
## 4.18.2 release (2025-02-20)
1543

0 commit comments

Comments
 (0)