-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from heidemn/fix-import-for-importmap
Add .js file extension to import, to make importmap work out of the box
- Loading branch information
Showing
2 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
// In pure ESM web bundles, you must call init() and wait for the promised result before you can | ||
// call any module methods. To make that as easy as possible, this module directly exposes the | ||
// init() promise result, and returns the methods at the end of the promise. | ||
import init, * as brotliWasm from "./pkg.web/brotli_wasm"; | ||
// https://github.com/WICG/import-maps?tab=readme-ov-file#extension-less-imports | ||
// For usage with an importmap, it's convenient to add the ".js" extension here, because browsers | ||
// don't try to guess the file extension. | ||
import init, * as brotliWasm from "./pkg.web/brotli_wasm.js"; | ||
export default init().then(() => brotliWasm); |