Files
wasm/rollup.config.mjs
T
Jaco 49ab036894 Split into common wasm-bridge package (#346)
* Split into common wasm-bridge package

* README

* Adjust rollup bundling

* Adjust

* Adjust

* Adjust, full re-usable

* Cleanup deps

* Restore initWasm exports from init*

* Split base64 & fflate into wasm-util

* sideEffects for wasm-util

* Dedupe types

* Additional

* Adjust

* Expose error on InitResult

* Bump deps

* CHANGELOG

* Re-usable rollup config
2022-05-12 08:29:21 +03:00

38 lines
774 B
JavaScript

// Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { createBundle } from '@polkadot/dev/config/rollup';
const pkgs = [
'@polkadot/wasm-crypto'
];
const external = [
...pkgs,
'@polkadot/util'
];
const overrides = pkgs
.map((n) => n.replace('@polkadot/wasm-', ''))
.reduce((map, n) => ({
...map,
[`@polkadot/wasm-${n}`]: {
entries: [
'bridge',
'util',
...['init', 'asmjs', 'wasm'].map((p) => `${n}-${p}`)
].reduce((all, p) => ({
...all,
[`@polkadot/wasm-${p}`]: `../../wasm-${p}/build/bundle.js`
}), {})
}
}), {});
export default pkgs.map((pkg) =>
createBundle({
external,
pkg,
...(overrides[pkg] || {})
})
);