-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
39 lines (37 loc) · 969 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
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import resolve from '@rollup/plugin-node-resolve';
import babel from '@rollup/plugin-babel';
import { terser } from 'rollup-plugin-terser';
import ts from 'rollup-plugin-ts';
// @ts-ignore JSON is not correctly validated via TSLint
import { dependencies, main, module, peerDependencies } from './package.json';
const extensions = ['.js', '.ts'];
export default [
{
input: 'src/index.ts',
external: [...Object.keys(dependencies || {}), ...Object.keys(peerDependencies || {})],
output: [
{
file: main,
format: 'esm',
},
{
file: module,
format: 'esm',
},
],
plugins: [
ts(),
json(),
resolve({ extensions, preferBuiltins: true }),
commonjs(),
babel({
extensions,
include: ['src/**/*'],
babelHelpers: 'bundled',
}),
terser(),
],
}
];