-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrollup.config.js
60 lines (41 loc) · 1.5 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
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import babel from '@rollup/plugin-babel';
import cleanup from "rollup-plugin-cleanup";
const name = 'smart-health-card-decoder';
const extensions = ['.js', '.ts'];
export default [{
input: './src/index.ts',
external: [],
plugins: [
// Allows node_modules resolution
resolve({ extensions, browser: true, preferBuiltins: false }),
// Allow bundling cjs modules. Rollup doesn't understand cjs
commonjs(),
cleanup({
extensions: ['js'],
comments: 'none'
}),
// Compile TypeScript/JavaScript files
babel({
// .ts extensions required for babel to process TypeScript files
extensions,
babelHelpers: 'bundled',
// we need to transpile any dependencies that are not appropriate for the target
exclude: [
// exclude fflate as it appears es5
'node_modules\/(?!(fflate)\/).*',
// we exclude core-js or we get a bunch of circular dependencies
/\/core-js\//
]
}),
],
output: [
{
file: `./umd/${name.toLowerCase()}.umd.js`,
format: 'umd',
name,
banner: '// Copyright by the Computational Health Informatics Program, Boston Children\'s Hospital, Boston, MA\n// Licensed under the MIT license.\n'
}
]
}];