-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathrollup.config.ts
57 lines (48 loc) · 1.13 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
47
48
49
50
51
52
53
54
55
56
57
import sourceMaps from 'rollup-plugin-sourcemaps';
import typescript from 'rollup-plugin-typescript2';
const pkg = require('./package.json');
const libraryName = 'shepherd';
const external = [
'remote-redux-devtools',
'crypto',
'redux-saga/effects',
...Object.keys(pkg.dependencies || {}),
];
const globals = {
redux: 'redux',
'bn.js': 'bn.js',
jsonschema: 'jsonschema',
crypto: 'crypto',
'url-search-params': 'url-search-params',
'redux-saga': 'redux-saga',
'redux-saga/effects': 'redux-saga/effects',
'remote-redux-devtools': 'remote-redux-devtools',
btoa: 'btoa',
};
export default {
input: `src/index.ts`,
output: [
{
file: pkg.main,
name: libraryName,
format: 'umd',
globals,
sourcemap: true,
},
{ file: pkg.module, format: 'es', globals, sourcemap: true },
],
// exclude all node modules
external,
watch: {
include: 'src/**',
},
plugins: [
// Compile TypeScript files
typescript({
useTsconfigDeclarationDir: true,
tsconfig: './tsconfig-build.json',
}),
// Resolve source maps to the original source
sourceMaps(),
],
};