-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
37 lines (30 loc) · 888 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
import uglify from 'rollup-plugin-uglify';
var MINIFY = process.env.MINIFY;
var pkg = require('./package.json');
var banner =
`/**
* ${pkg.description}
* @author ${pkg.author}
* @version v${pkg.version}
* @link ${pkg.homepage}
* @license MIT License, http://www.opensource.org/licenses/MIT
*/`;
var uglifyOpts = { output: {} };
// retain multiline comment with @license
uglifyOpts.output.comments = (node, comment) =>
comment.type === 'comment2' && /@license/i.test(comment.value);
var plugins = [];
if (MINIFY) plugins.push(uglify(uglifyOpts));
var extension = MINIFY ? 'min.js' : 'js';
const CONFIG = {
sourceMap: false,
format: 'umd',
plugins: plugins,
banner: banner,
moduleName: 'angular-disqus-comments',
entry: 'lib/index.js',
dest: `dist/angular-disqus-comments.${extension}`,
globals: {angular: 'angular'},
external: 'angular',
};
export default CONFIG;