-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathrollup.config.js
46 lines (41 loc) · 999 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
43
44
45
46
// Rollup plugins
import babel from "rollup-plugin-babel";
import uglify from "rollup-plugin-uglify";
import license from "rollup-plugin-license";
import { minify } from "uglify-es";
import pkjson from "./package.json";
const banner = `/*!
* Agile v${pkjson.version}
* https://github.com/drawcall/Agile
*
* Copyright 2012-${new Date().getFullYear()}, drawcall
* Licensed under the MIT license
* http://www.opensource.org/licenses/mit-license
*
*/`;
const isDev = process.argv.splice(2).indexOf("--pub") < 0;
const plugins = isDev
? [
babel({
exclude: "node_modules/**"
})
]
: [
babel({
exclude: "node_modules/**"
}),
uglify({}, minify),
license({ banner: banner })
];
const output = isDev ? { file: "build/agile.js" } : { file: "build/agile.min.js" };
export default {
input: "src/index.js",
output: {
...output,
format: "umd",
name: "Agile",
//exports: "named",
sourcemap: true
},
plugins: plugins
};