-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
59 lines (57 loc) · 1.13 KB
/
rollup.config.mjs
File metadata and controls
59 lines (57 loc) · 1.13 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
import json from '@rollup/plugin-json';
import typescript from 'rollup-plugin-typescript2';
import nodePolyfills from 'rollup-plugin-polyfill-node';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
const commonPlugins = [
resolve({
browser: true,
preferBuiltins: false,
}),
commonjs({
include: /node_modules/,
requireReturnsDefault: 'auto',
}),
nodePolyfills(),
json(),
typescript({
tsconfig: './tsconfig.json',
tsconfigOverride: { declaration: false },
check: false,
clean: true,
}),
];
export default [
{
input: 'src/index.ts',
output: {
file: 'dist/bundle.cjs.cjs',
format: 'cjs',
sourcemap: true,
exports: 'named',
},
plugins: commonPlugins,
external: [
'axios',
'js-sha3',
'bs58',
'big-integer',
'int64-buffer',
'ethers',
'buffer',
],
},
{
input: 'src/index.ts',
output: {
file: 'dist/bundle.esm.mjs',
format: 'esm',
sourcemap: true,
},
plugins: commonPlugins,
external: [
'axios',
'ethers',
],
},
];