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: CHANGELOG.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,19 @@
1
1
# Changelog
2
2
3
+
## Unreleased
4
+
5
+
* Add support for `with { type: 'bytes' }` imports ([#4292](https://github.com/evanw/esbuild/issues/4292))
6
+
7
+
The [import bytes](https://github.com/tc39/proposal-import-bytes) proposal has reached stage 2.7 in the TC39 process, which means that although it isn't quite recommended for implementation, it's generally approved and ready for validation. Furthermore it has already been implemented by [Deno](https://docs.deno.com/examples/importing_bytes/) and [Webpack](https://github.com/webpack/webpack/pull/19928). So with this release, esbuild will also add support for this. It behaves exactly the same as esbuild's existing [`binary` loader](https://esbuild.github.io/content-types/#binary). Here's an example:
8
+
9
+
```js
10
+
importdatafrom'./image.png' with { type: 'bytes' }
11
+
constview=newDataView(data.buffer, 0, 24)
12
+
constwidth=view.getInt32(16)
13
+
constheight=view.getInt32(20)
14
+
console.log('size:', width +'\xD7'+ height)
15
+
```
16
+
3
17
## 0.25.10
4
18
5
19
* Fix a panic in a minification edge case ([#4287](https://github.com/evanw/esbuild/issues/4287))
0 commit comments