forked from compound-finance/compound-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.ts
41 lines (39 loc) · 937 Bytes
/
rollup.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
35
36
37
38
39
40
41
// Rollup builds only the browser version using the Node.js build.
import { nodeResolve as resolve } from '@rollup/plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import minify from 'rollup-plugin-babel-minify';
import json from '@rollup/plugin-json';
const BrowserBuildPath = './dist/browser/compound.min.js';
export default [{
input: './dist/nodejs/index.js',
onwarn: (message) => {
if (message.code === 'MISSING_NODE_BUILTINS') return;
},
output: {
name: 'Compound',
file: BrowserBuildPath,
format: 'iife',
sourcemap: false,
globals: {
'http': '{}',
'https': '{}',
},
},
plugins: [
resolve({
preferBuiltins: true,
jsnext: true,
main: true,
browser: true,
}),
commonjs({
namedExports: { Compound: ['Compound'] },
}),
minify({ comments: false }),
json(),
],
external: [
'http',
'https',
]
}];