-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: compile key manager to wasm and add javascript interface
- Loading branch information
Byron Hambly
committed
Nov 12, 2021
1 parent
3b84b17
commit eb545e1
Showing
19 changed files
with
787 additions
and
21,225 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
INLINE_RUNTIME_CHUNK=false |
This file was deleted.
Oops, something went wrong.
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,26 @@ | ||
const path = require("path"); | ||
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin"); | ||
const KEY_MANAGER_PATH = "../../base_layer/key_manager/"; | ||
const { override, addWebpackPlugin } = require("customize-cra"); | ||
|
||
const wasmPlugin = new WasmPackPlugin({ | ||
crateDirectory: path.resolve(__dirname, KEY_MANAGER_PATH), | ||
watchDirectories: [path.resolve(__dirname, KEY_MANAGER_PATH)], | ||
outDir: path.resolve(__dirname, "src/key_manager/"), | ||
extraArgs: "-- --features js", | ||
}); | ||
|
||
module.exports = override(addWebpackPlugin(wasmPlugin), (config) => { | ||
config.resolve.extensions.push(".wasm"); | ||
|
||
config.module.rules.forEach((rule) => { | ||
(rule.oneOf || []).forEach((oneOf) => { | ||
if (oneOf.loader && oneOf.loader.indexOf("file-loader") >= 0) { | ||
// Make file-loader ignore WASM files | ||
oneOf.exclude.push(/\.wasm$/); | ||
} | ||
}); | ||
}); | ||
|
||
return config; | ||
}); |
Oops, something went wrong.