forked from Swyftx/crypto-address-validator
-
Notifications
You must be signed in to change notification settings - Fork 4
/
rollup.config.ts
46 lines (40 loc) · 1.11 KB
/
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
42
43
44
45
46
import commonjs from '@rollup/plugin-commonjs'
import { nodeResolve } from '@rollup/plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2';
import { uglify } from "rollup-plugin-uglify";
const pkg = require('./package.json');
const libraryName = 'crypto-address-validator';
export default {
input: `src/wallet_address_validator.ts`,
external: ['readable-stream', 'readable-stream/transform'],
output: [
{
format: 'umd',
file: pkg.main,
name: libraryName,
sourcemap: true,
},
{
format: 'es',
file: pkg.module,
sourcemap: true,
},
],
// Order is important, look for packages github/npm
plugins: [
nodeResolve({
browser: true, // This disabled binding for some crypto modules like keccak
preferBuiltins: true
}),
// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
commonjs(),
uglify(),
// Compile TypeScript files
// MUST BE AFTER nodeResolve
typescript({
useTsconfigDeclarationDir: true,
objectHashIgnoreUnknownHack: false,
clean: true,
}),
]
};