Skip to content

Commit a2361c1

Browse files
Martin Heideheidemn
authored andcommitted
Add .js file extension to import, to make importmap work out of the box
1 parent 0842adc commit a2361c1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

index.web.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// In pure ESM web bundles, you must call init() and wait for the promised result before you can
22
// call any module methods. To make that as easy as possible, this module directly exposes the
33
// init() promise result, and returns the methods at the end of the promise.
4-
import init, * as brotliWasm from "./pkg.web/brotli_wasm";
4+
// https://github.com/WICG/import-maps?tab=readme-ov-file#extension-less-imports
5+
// For usage with an importmap, it's convenient to add the ".js" extension here, because browsers
6+
// don't try to guess the file extension.
7+
import init, * as brotliWasm from "./pkg.web/brotli_wasm.js";
58
export default init().then(() => brotliWasm);

0 commit comments

Comments
 (0)