forked from polkadot-js/api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.mjs
43 lines (35 loc) · 929 Bytes
/
rollup.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2017-2021 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import path from 'path';
import { createBundle } from '@polkadot/dev/config/rollup';
const pkgs = [
'@polkadot/api',
'@polkadot/api-contract',
'@polkadot/types'
];
const external = [
...pkgs,
'@polkadot/keyring',
'@polkadot/util',
'@polkadot/util-crypto'
];
const entries = ['api-derive', 'rpc-core', 'rpc-provider', 'types-known'].reduce((all, p) => ({
...all,
[`@polkadot/${p}`]: path.resolve(process.cwd(), `packages/${p}/build/bundle.js`)
}), {
// re-exported in @polkadot/util-crypto, map directly
'@polkadot/networks': '@polkadot/util-crypto'
});
const overrides = {};
export default pkgs.map((pkg) => {
const override = (overrides[pkg] || {});
return createBundle({
external,
pkg,
...override,
entries: {
...entries,
...(override.entries || {})
}
});
});