Skip to content

Commit 1c60511

Browse files
committed
add esbuild and parcel and fix bun version
1 parent abd3007 commit 1c60511

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,23 +83,34 @@ The determination of whether the `type` attribute is part of the module cache ke
8383

8484
### Is there any prior art?
8585

86-
Deno 2.4 added support in [July 2025](https://deno.com/blog/v2.4).
86+
Deno 2.4 added support in [July 2025](https://deno.com/blog/v2.4) to inline a Uint8Array
8787

8888
```js
8989
import imageBytes from "./image.png" with { type: "bytes" };
9090
```
9191

92-
Bun 1.1.5 added a similar feature in [April 2024](https://bun.sh/blog/bun-v1.1.5).
92+
Bun 1.1.7 added a similar feature in [May 2024](https://bun.sh/blog/bun-v1.1.7) to inline a string of text
9393

9494
```js
9595
import html from "./index.html" with { type: "text" };
9696
```
9797

98-
Webpack has [asset modules](https://webpack.js.org/guides/asset-modules/) to inline a data URI via [url-loader](https://www.npmjs.com/package/url-loader) and now `asset/inline`.
98+
webpack added [asset modules](https://webpack.js.org/guides/asset-modules/) to inline a base64 data URI via [url-loader](https://www.npmjs.com/package/url-loader) in 4.x and now `asset/inline` in 5.x
9999

100100
```js
101-
import logo from './images/logo.svg';
102-
block.style.background = url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDo...vc3ZnPgo=)
101+
import logo from "./images/logo.svg"
102+
```
103+
104+
esbuild added a [binary loader](https://esbuild.github.io/content-types/#binary) to inline a Uint8Array
105+
106+
```js
107+
import uint8array from "./example.data"
108+
```
109+
110+
Parcel added a [data url](https://parceljs.org/features/bundle-inlining/#inlining-as-a-data-url) scheme to inline a base64 data URI
111+
112+
```js
113+
import background from "data-url:./background.png";
103114
```
104115

105116
### What about ArrayBuffer vs Uint8Array?

0 commit comments

Comments
 (0)