-
Notifications
You must be signed in to change notification settings - Fork 8
/
rollup.config.js
42 lines (41 loc) · 1.11 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
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
import { terser } from 'rollup-plugin-terser';
import pkg from './package.json' assert { type: 'json' };
export default {
input: {
'.': 'src/index.ts',
'chain-cache': 'src/chain-cache/index.ts',
'contracts-api': 'src/contracts-api/index.ts',
'strategy-management': 'src/strategy-management/index.ts',
'trade-matcher': 'src/trade-matcher/index.ts',
utils: 'src/utils/index.ts',
},
output: [
{
dir: 'dist',
format: 'cjs',
entryFileNames: '[name]/index.cjs',
chunkFileNames: '[name]-[hash].cjs',
},
{
dir: 'dist',
format: 'esm',
entryFileNames: '[name]/index.js',
chunkFileNames: '[name]-[hash].js',
preserveModules: true,
preserveModulesRoot: 'src',
},
],
plugins: [
resolve(),
commonjs(),
typescript(),
terser(), // Minifies the bundle
],
external: [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
],
};