-
Notifications
You must be signed in to change notification settings - Fork 2
/
rollup.config.mjs
45 lines (43 loc) · 1 KB
/
rollup.config.mjs
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
import dts from 'rollup-plugin-dts'
import esbuild from 'rollup-plugin-esbuild'
import babel from '@rollup/plugin-babel'
import url from '@rollup/plugin-url'
function bundle(config) {
return {
...config,
external: ['react', 'react/jsx-runtime', '@streamr/sdk', 'process', 'react-fast-compare'],
}
}
export default [
bundle({
input: './src/index.ts',
plugins: [
url(),
esbuild(),
babel({
babelHelpers: 'bundled',
extensions: ['.ts', '.tsx'],
}),
],
output: [
{
file: `./index.js`,
format: 'es',
},
{
file: './index.cjs',
format: 'cjs'
}
],
}),
bundle({
input: './src/index.ts',
plugins: [url(), dts()],
output: [
{
file: `./index.d.ts`,
format: 'es',
},
],
}),
]