Allow esm builds (#157)

This commit is contained in:
Jaco Greeff
2020-12-11 16:45:56 +01:00
committed by GitHub
parent 9c09490f62
commit 3e1249ca2c
10 changed files with 45 additions and 49 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2020 @polkadot/bytes-asmjs-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
export default null;
export const asmJsInit = null;
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2020 @polkadot/bytes-asmjs-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
export default null;
export const asmJsInit = null;
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2020 @polkadot/bytes-wasm-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
export default null;
export const wasmBytes = null;
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2020 @polkadot/bytes-wasm-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
export default null;
export const wasmBytes = null;
+3 -3
View File
@@ -9,9 +9,9 @@
"@polkadot/bytes-wasm-crypto": "^2.0.2-12"
},
"devDependencies": {
"@polkadot/dev": "^0.60.23",
"@polkadot/util": "^4.2.2-11",
"@polkadot/x-randomvalues": "^4.2.2-11",
"@polkadot/dev": "^0.60.27",
"@polkadot/util": "^4.2.2-12",
"@polkadot/x-randomvalues": "^4.2.2-12",
"override-require": "^1.1.1"
},
"peerDependencies": {
+3 -3
View File
@@ -1,13 +1,13 @@
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import asmFallback from '@polkadot/bytes-asmjs-crypto';
import wasmBytes from '@polkadot/bytes-wasm-crypto';
import { asmJsInit } from '@polkadot/bytes-asmjs-crypto';
import { wasmBytes } from '@polkadot/bytes-wasm-crypto';
import { allocString, allocU8a, getWasm, initWasm, resultString, resultU8a, withWasm } from './bridge';
import * as imports from './imports';
const wasmPromise = initWasm(wasmBytes, asmFallback, imports).catch(() => null);
const wasmPromise = initWasm(wasmBytes, asmJsInit, imports).catch(() => null);
export const bip39Generate = withWasm((wasm) =>
(words: 12 | 15 | 18 | 21 | 24): string => {