-
Notifications
You must be signed in to change notification settings - Fork 138
/
rollup.config.js
67 lines (64 loc) · 1.63 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { babel } from '@rollup/plugin-babel';
import terser from '@rollup/plugin-terser';
import typescript from '@rollup/plugin-typescript';
const LICENSE =
`/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
* Portions Copyright (C) Philipp Kewisch */`;
const TERSER_OPTIONS = {
format: {
comments: function(node, comment) {
if (comment.type == 'comment2') {
return /terms of the Mozilla Public/.test(comment.value) && comment.pos === 0;
}
return false;
}
}
};
export default [{
input: 'lib/ical/module.js',
output: [
{ file: 'dist/ical.js', format: 'es', exports: 'default' },
{
file: 'dist/ical.min.js',
banner: LICENSE,
format: 'es',
exports: 'default',
plugins: [terser(TERSER_OPTIONS)]
}
]
}, {
input: 'lib/ical/module.js',
output: [
{
file: 'dist/ical.es5.cjs',
exports: 'default',
name: 'ICAL',
format: 'umd',
banner: LICENSE,
},
{
file: 'dist/ical.es5.min.cjs',
exports: 'default',
name: 'ICAL',
format: 'umd',
banner: LICENSE,
plugins: [terser(TERSER_OPTIONS)],
}
],
plugins: [
babel({ babelHelpers: 'bundled', presets: ['@babel/preset-env'] }),
typescript({
include: ['lib/ical/*.js'],
noForceEmit: true,
compilerOptions: {
allowJs: true,
declaration: true,
emitDeclarationOnly: true,
declarationMap: true,
declarationDir: 'dist/types',
},
})
]
}];