-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrollup.config.js
34 lines (32 loc) · 880 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
import typescript from '@rollup/plugin-typescript';
import external from 'rollup-plugin-peer-deps-external';
import dts from 'rollup-plugin-dts';
import { terser } from 'rollup-plugin-terser';
import pkg from './package.json';
const name = 'Complex';
const input = 'complex.ts';
const moo = 'moo';
const nearley = 'nearley';
const globals = { moo, nearley };
export default [
{
input,
output: { file: pkg.module, format: 'es' },
plugins: [external(), typescript()]
},
{
input,
output: { file: pkg.main, format: 'commonjs', name },
plugins: [external(), typescript({ target: 'es5' })]
},
{
input,
output: { file: pkg.browser, format: 'umd', name, globals, sourcemap: true },
plugins: [external(), typescript({ target: 'es5' }), terser()]
},
{
input,
output: { file: pkg.types, format: 'es' },
plugins: [dts()]
}
];