-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding an index and wasm files to initialize the module
this maintains API compatibility with the versions that used to be compiled with the older emscripten
- Loading branch information
Showing
4 changed files
with
62 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./libheif/libheif.js')(); |
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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// I technically don't have to do this, but I am keeping it around | ||
// for demonstration purposes | ||
const fs = require('fs'); | ||
const wasmBinary = fs.readFileSync('./libheif-wasm/libheif.wasm'); | ||
|
||
module.exports = require('./libheif-wasm/libheif.js')({ wasmBinary }); | ||
|
||
// NOTE: for webpack, you need to do something like: | ||
/* | ||
import libheif from './libheif-wasm/libheif.js' | ||
import wasmBinary from './libheif-wasm/libheif.wasm' | ||
export default libheif({ wasmBinary }); | ||
*/ | ||
|
||
// then add this to rules: | ||
/* | ||
module.exports = { | ||
module: { | ||
rules: [{ | ||
test: /\.wasm$/, | ||
type: "asset/inline", | ||
}] | ||
}, | ||
}; | ||
*/ |