Skip to content

Commit

Permalink
feat: compile key manager to wasm and add javascript interface (#3565)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron Hambly committed Nov 12, 2021
1 parent 3b84b17 commit 35790d6
Show file tree
Hide file tree
Showing 19 changed files with 787 additions and 21,225 deletions.
44 changes: 42 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions applications/tari_web_extension/.env.production
@@ -0,0 +1 @@
INLINE_RUNTIME_CHUNK=false
30 changes: 0 additions & 30 deletions applications/tari_web_extension/_webpack.config.js

This file was deleted.

26 changes: 26 additions & 0 deletions applications/tari_web_extension/config-overrides.js
@@ -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;
});

0 comments on commit 35790d6

Please sign in to comment.