-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathrollup.config.cjs
More file actions
73 lines (70 loc) · 2.05 KB
/
rollup.config.cjs
File metadata and controls
73 lines (70 loc) · 2.05 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
const path = require("path");
const resolve = require("@rollup/plugin-node-resolve");
const commonjs = require("@rollup/plugin-commonjs");
const json = require("@rollup/plugin-json");
const builtins = require("builtin-modules");
const { visualizer } = require("rollup-plugin-visualizer");
const commonConfig = {
plugins: [
resolve({ preferBuiltins: true }),
commonjs(),
json({ compact: true }),
// Generates a stats.html file in the actions folder.
// This is a visual of the Action dependencies for the last Action in the rollup config.
visualizer(),
],
// Do not bundle these packages.
// ethers is required to be bundled as we need v6 and not v5 that is packaged with Defender Actions.
external: [
...builtins,
"axios",
"chai",
"node-fetch",
/^defender-relay-client(\/.*)?$/,
"@openzeppelin/defender-relay-client/lib/ethers",
"@openzeppelin/defender-sdk",
"@openzeppelin/defender-autotask-client",
"@openzeppelin/defender-kvstore-client",
"@openzeppelin/defender-relay-client/lib/ethers",
"@nomicfoundation/solidity-analyzer-darwin-arm64",
"@nomicfoundation/solidity-analyzer-darwin-x64",
/^@nomicfoundation\/edr-.*$/,
"fsevents",
],
};
const actions = [
"autoRequestWithdraw",
"autoClaimWithdraw",
"autoRequestWithdrawSonic",
"autoClaimWithdrawSonic",
"autoRequestLidoWithdraw",
"autoClaimLidoWithdraw",
"autoRequestEtherFiWithdraw",
"autoClaimEtherFiWithdraw",
"autoRequestEthenaWithdraw",
"autoClaimEthenaWithdraw",
"collectLidoFees",
"collectFeesSonic",
"collectEtherFiFees",
"collectEthenaFees",
"collectOETHFees",
"collectRewardsSonic",
"allocateLido",
"allocateEtherFi",
"allocateEthena",
"allocateOETH",
"allocateSonic",
"setOSSiloPriceAction",
"setPricesLido",
"setPricesEtherFi",
"setPricesEthena",
"setPricesOETH",
];
module.exports = actions.map((action) => ({
input: path.resolve(__dirname, `${action}.js`),
output: {
file: path.resolve(__dirname, `dist/${action}/index.js`),
format: "cjs",
},
...commonConfig,
}));