-
Notifications
You must be signed in to change notification settings - Fork 822
/
rollup.config.js
55 lines (49 loc) · 1.06 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
import license from "rollup-plugin-license";
import { uglify } from "rollup-plugin-uglify";
import filesize from "rollup-plugin-filesize";
import { eslint } from "rollup-plugin-eslint";
const input = "src/Headroom.js";
const output = {
format: "umd",
name: "Headroom"
};
const licensePlugin = license({
banner: {
commentStyle: "ignored",
content: `<%= pkg.name %> v<%= pkg.version %> - <%= pkg.description %>
Copyright (c) <%= moment().format('YYYY') %> <%= pkg.author %> - <%= pkg.homepage %>
License: <%= pkg.license %>`
}
});
const unminified = {
input,
output: {
...output,
file: "dist/headroom.js"
},
plugins: [
eslint(),
licensePlugin,
filesize({
showMinifiedSize: false,
showGzippedSize: false
})
]
};
const minified = {
input,
output: {
...output,
file: "dist/headroom.min.js",
compact: true
},
plugins: [
uglify(),
licensePlugin,
filesize({
showMinifiedSize: false,
showBrotliSize: true
})
]
};
export default [unminified, minified];