-
Notifications
You must be signed in to change notification settings - Fork 14
/
rollup.config.ts
58 lines (55 loc) · 1.22 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
58
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from 'rollup-plugin-typescript2';
import json from '@rollup/plugin-json';
import { terser } from 'rollup-plugin-terser';
import replace from '@rollup/plugin-replace';
import copy from 'rollup-plugin-copy';
const OUTPUT_DATA = [
{
input: 'src/index.ts',
file: 'dist/index.esm.js',
format: 'es',
},
{
input: 'src/index.ts',
file: 'dist/index.js',
format: 'umd',
},
];
const config = OUTPUT_DATA.map(({ file, format, input }) => ({
input,
output: {
file,
format,
sourcemap: true,
name: 'logdna',
},
external: [],
watch: {
include: 'src/**',
},
plugins: [
json(),
typescript({
useTsconfigDeclarationDir: true,
}),
commonjs(),
resolve(),
replace({
preventAssignment: true,
'process.env.FORCE_SIMILAR_INSTEAD_OF_MAP': 'false',
}),
terser({
format: {
// I don't believe TSLib needs its license to be distributed with
// the bundled JS
comments: false,
},
}),
copy({
targets: [{ src: 'src/logdna.d.ts', dest: 'dist/types' }],
}),
],
}));
export default config;