-
Notifications
You must be signed in to change notification settings - Fork 26
/
rollup.config.ts
44 lines (41 loc) · 893 Bytes
/
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
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import sourceMaps from 'rollup-plugin-sourcemaps'
import typescript from 'rollup-plugin-typescript2'
import json from 'rollup-plugin-json'
// tslint:disable
const pkg = require('./package.json')
const libraryName = 'reworm'
const globals = {
react: 'React',
'react-dom': 'ReactDom',
}
export default {
input: `src/${libraryName}.tsx`,
output: [
{
globals,
file: pkg.main,
name: libraryName,
format: 'umd',
sourcemap: true,
},
{
globals,
file: pkg.module,
format: 'es',
sourcemap: true,
},
],
external: ['react', 'react-dom', 'prop-types'],
watch: {
include: 'src/**',
},
plugins: [
json(),
typescript({ useTsconfigDeclarationDir: true }),
commonjs(),
resolve(),
sourceMaps(),
],
}