-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtsup.config.ts
34 lines (31 loc) · 940 Bytes
/
tsup.config.ts
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
import { defineConfig } from 'tsup';
import Configstore from 'configstore';
import pkg from './package.json';
const config = new Configstore(pkg.name);
export default defineConfig((opt) => {
return {
esbuildOptions: (options, context) => {
const CHAIN_ID = config.get('CHAIN_ID');
if (!CHAIN_ID || !(`${CHAIN_ID}` in config.all))
throw new Error(
'Missing chain configuration! Try running `yarn start` first to set the config.',
);
options.define = {
...(options.define ?? {}),
BUILD_CHAIN_ID: `'${CHAIN_ID}'`,
BUILD_JSON_RPC_URI: `'${config.get(`${CHAIN_ID}.JSON_RPC_URI`)}'`,
};
},
noExternal: [
'@pooltogether/v5-autotasks-library',
'@pooltogether/v5-utils-js',
'ethereum-multicall',
'configstore',
],
format: 'cjs',
entry: ['src/handler.ts'],
splitting: false,
clean: true,
minify: true,
};
});