forked from swapkit/SwapKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.size-limit.js
More file actions
54 lines (48 loc) · 1.41 KB
/
Copy path.size-limit.js
File metadata and controls
54 lines (48 loc) · 1.41 KB
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
const sizeMap = {
xxs: "1 KB",
xs: "5 KB",
s: "10 KB",
m: "25 KB",
l: "50 KB",
xl: "125 KB",
xxl: "200 KB",
tokens: "1 MB",
};
function getSizeFor(packagePath, sizeType) {
const size = sizeMap[sizeType];
if (!size) throw new Error(`Unknown size type ${sizeType}`);
const [, packageName] = packagePath.split("/");
const packagePrefix = packagePath.includes("toolboxes")
? "toolbox-"
: packagePath.includes("wallets")
? "wallet-"
: "";
return [
{
limit: size,
path: `./packages/${packagePath}/dist/*.js`,
name: `@swapkit/${packagePrefix}${packageName}`,
},
];
}
module.exports = [
...getSizeFor("swapkit/api", "s"),
...getSizeFor("swapkit/chainflip", "xs"),
...getSizeFor("swapkit/core", "m"),
...getSizeFor("swapkit/helpers", "m"),
...getSizeFor("swapkit/sdk", "xxs"),
...getSizeFor("swapkit/thorchain", "s"),
...getSizeFor("swapkit/tokens", "tokens"),
...getSizeFor("toolboxes/cosmos", "m"),
...getSizeFor("toolboxes/evm", "m"),
...getSizeFor("toolboxes/substrate", "xs"),
...getSizeFor("toolboxes/utxo", "m"),
...getSizeFor("wallets/evm-extensions", "xxs"),
...getSizeFor("wallets/keplr", "xxs"),
...getSizeFor("wallets/keystore", "xl"),
...getSizeFor("wallets/ledger", "xxl"),
...getSizeFor("wallets/okx", "xs"),
...getSizeFor("wallets/trezor", "xs"),
...getSizeFor("wallets/wc", "xs"),
...getSizeFor("wallets/xdefi", "xs"),
];