Files
wasm/scripts/pack-wasm-base.js
T
Jaco Greeff 83762d9997 Polyfill require adjust (#128)
* Polyfill require adjust

* Assert in promise for getRandomBytes

* Adjust jest

* Revert explicit overrides (from base)

* use typeof

* Re-add crypto-polyfill (backwards, direct imports)

* crypto log

* Fix dev

* Adjust
2020-11-01 18:53:09 +01:00

13 lines
408 B
JavaScript
Executable File

// Copyright 2019-2020 @polkadot/wasm authors & contributors
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable @typescript-eslint/no-var-requires */
const fs = require('fs');
const buffer = fs.readFileSync('./build/wasm_opt.wasm');
fs.writeFileSync('./build/wasm_wasm.js', `// Generated as part of the build, do not edit
module.exports = Buffer.from('${buffer.toString('base64')}', 'base64');
`);