-
Notifications
You must be signed in to change notification settings - Fork 75
/
rollup.config.js
58 lines (49 loc) · 1.12 KB
/
rollup.config.js
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright 2017-2024 @polkadot/ui-shared authors & contributors
// SPDX-License-Identifier: Apache-2.0
import path from 'path';
import { createBundle } from '@polkadot/dev/config/rollup';
const pkgs = [
'@polkadot/react-identicon',
'@polkadot/react-qr',
'@polkadot/ui-keyring',
'@polkadot/ui-settings',
'@polkadot/vue-identicon'
];
const external = [
...pkgs,
'@polkadot/hw-ledger',
'@polkadot/keyring',
'@polkadot/util',
'@polkadot/util-crypto',
'react',
'react-dom',
'vue',
'vue-router'
];
const globals = {
react: 'React',
'react-dom': 'ReactDOM',
vue: 'Vue',
'vue-router': 'VueRouter'
};
const entries = ['ui-shared'].reduce((all, p) => ({
...all,
[`@polkadot/${p}`]: path.resolve(process.cwd(), `packages/${p}/build`)
}), {
// 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,
globals,
pkg,
...override,
entries: {
...entries,
...(override.entries || {})
}
});
});