generated from dev-protocol/template-repos-ts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
51 lines (48 loc) · 1.34 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
43
44
45
46
47
48
49
50
51
/* eslint-disable functional/prefer-immutable-types */
/* eslint-disable functional/prefer-tacit */
import dts from 'rollup-plugin-dts'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import nodePolyfills from 'rollup-plugin-node-polyfills'
const apis = [
['dist/web3modal/ethereum.js', 'dist/web3modal/ethereum'],
['dist/web3modal/react.js', 'dist/web3modal/react'],
// ['dist/viem.js', 'dist/viem'],
// ['dist/wagmi/index.js', 'dist/wagmi'],
// ['dist/wagmi/chains.js', 'dist/wagmi/chains'],
]
const dfiles = [
[
'src/web3modal/ethereum.ts',
['dist/web3modal/ethereum.d.ts', 'web3modal/ethereum.d.ts'],
],
[
'src/web3modal/react.ts',
['dist/web3modal/react.d.ts', 'web3modal/react.d.ts'],
],
// ['src/viem.ts', ['dist/viem.d.ts', 'viem.d.ts']],
// ['src/wagmi/index.ts', ['dist/wagmi/index.d.ts', 'wagmi/index.d.ts']],
// ['src/wagmi/chains.ts', ['dist/wagmi/chains.d.ts', 'wagmi/chains.d.ts']],
]
export default [
...apis.map(([input, dir]) => ({
input,
external: ['viem', 'wagmi'],
output: [
{
dir,
format: 'es',
},
],
plugins: [commonjs(), nodeResolve(), json(), nodePolyfills()],
})),
...dfiles.map(([input, files]) => ({
input,
output: files.map((file) => ({
file,
format: 'es',
})),
plugins: [dts()],
})),
]