This repository has been archived by the owner on Aug 27, 2021. It is now read-only.
forked from blocknative/web3-onboard
-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.config.js
86 lines (82 loc) · 1.84 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import svelte from 'rollup-plugin-svelte'
import resolve from '@rollup/plugin-node-resolve'
import json from '@rollup/plugin-json'
import image from '@rollup/plugin-image'
import typescript from 'rollup-plugin-typescript2'
import {
preprocess,
createEnv,
readConfigFile
} from '@pyoner/svelte-ts-preprocess'
const env = createEnv()
const compilerOptions = readConfigFile(env)
const opts = {
env,
compilerOptions: {
...compilerOptions,
allowNonTsExtensions: true
}
}
export default {
input: 'src/onboard.ts',
output: [
{
format: 'esm',
dir: 'dist/esm/'
},
{ format: 'cjs', dir: 'dist/cjs/' }
],
onwarn: (warning, warn) => {
// supress warning as Typescript removes type definitions
if (warning.code === 'NON_EXISTENT_EXPORT') {
return
}
warn(warning)
},
plugins: [
json(),
image(),
svelte({
preprocess: preprocess(opts)
}),
resolve({
browser: true,
dedupe: importee =>
importee === 'svelte' || importee.startsWith('svelte/'),
preferBuiltins: true
}),
typescript({
clean: true,
useTsconfigDeclarationDir: true
})
],
external: [
'bowser',
'bnc-sdk',
'bignumber.js',
'@portis/web3',
'@walletconnect/web3-provider',
'fortmatic',
'squarelink',
'authereum',
'@toruslabs/torus-embed',
'walletlink',
'@unilogin/provider',
'regenerator-runtime/runtime',
'trezor-connect',
'ethereumjs-tx',
'ethereumjs-util',
'hdkey',
'@ledgerhq/hw-transport-u2f',
'@ledgerhq/hw-app-eth',
'util',
'assert',
'buffer',
'stream',
'web3-provider-engine',
'web3-provider-engine/subproviders/hooked-wallet',
'web3-provider-engine/subproviders/rpc',
'web3-provider-engine/subproviders/subscriptions',
'web3-provider-engine/subproviders/filters'
]
}