-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathrollup.config.js
46 lines (42 loc) · 1.04 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
import babel from 'rollup-plugin-babel';
import serve from 'rollup-plugin-serve';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import plugins from './rollup.plugins.config';
import {uglify} from 'rollup-plugin-uglify';
export default [
{
input: './src/between.js',
output: {
format: 'umd',
file: './build/between.js',
name: 'Between',
banner: `/* Between.js v${require('./package.json').version} */`
},
plugins: [
resolve(),
babel({
exclude: 'node_modules/**'
}),
commonjs(),
...(process.env.NODE_ENV === 'production' ? [
uglify({
output: {
comments(node, comment) {
const {type, value} = comment;
if (type === 'comment2')
return /Between\.js/i.test(value);
}
}
})
] : [
serve({
open: true,
contentBase: ['./', './examples'],
port: 3000
})
])
]
},
plugins
];