generated from consenlabs/fe-public-template
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathrollup.config.js
45 lines (42 loc) · 896 Bytes
/
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
import typescript from 'rollup-plugin-typescript2'
import nodeResolve from '@rollup/plugin-node-resolve'
import localResolve from 'rollup-plugin-local-resolve'
import commonjs from '@rollup/plugin-commonjs'
import { terser } from 'rollup-plugin-terser'
import pkg from './package.json'
const extensions = ['.js', '.jsx', '.ts', '.tsx']
const plugins = [
typescript({
typescript: require('typescript'),
clean: true,
}),
localResolve(),
nodeResolve({
browser: true,
extensions,
}),
commonjs(),
]
export default {
input: 'src/index.ts',
output: [
{
file: pkg.main,
format: 'cjs',
exports: 'named',
},
{
file: pkg.module,
format: 'es',
exports: 'named',
},
{
file: pkg.browser,
format: 'umd',
exports: 'named',
name: 'TokenWebView',
plugins: [terser()],
},
],
plugins,
}