-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
42 lines (37 loc) · 898 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
35
36
37
38
39
40
41
42
/* @flow */
import babel from 'rollup-plugin-babel';
import { uglify } from 'rollup-plugin-uglify';
import pkg from './package.json';
const devDependencies = Object.keys(pkg.devDependencies || {});
/* prettier-ignore */
const banner =
'/*!\n' +
' * ' + pkg.name + ' v' + pkg.version + '\n' +
' * (c) 2019 - Present, ' + pkg.author.name + '\n' +
' * Released under the ' + pkg.license + ' License.\n' +
' */';
const config = {
input: 'src/index.js',
plugins: [
babel(),
uglify({
output: {
comments: (_, { value }) => value.includes('License'),
},
compress: {
pure_getters: true,
unsafe: true,
unsafe_comps: true,
},
warnings: false,
}),
],
output: {
file: 'dist/index.min.js',
format: 'iife',
name: 'Cancelable',
banner,
},
external: [...devDependencies],
};
export default config;