-
Notifications
You must be signed in to change notification settings - Fork 55
/
rollup.config.js
59 lines (57 loc) · 1.27 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
56
57
58
59
import { terser } from 'rollup-plugin-terser';
import css from 'rollup-plugin-css-only';
import CleanCSS from 'clean-css';
import { writeFileSync } from 'fs';
import pkg from './package.json'
const name = 'cxCalendar';
const about = `/**
* cxCalendar
* @version ${pkg.version}
* @author ciaoca
* @email ciaoca@gmail.com
* @site https://github.com/ciaoca/cxCalendar
* @license Released under the MIT license
*/`;
export default {
input: 'src/index.js',
output: [
{
file: 'dist/js/cxcalendar.js',
format: 'umd',
name: name,
banner: about,
indent: false,
},
{
file: 'dist/js/cxcalendar.min.js',
format: 'umd',
name: name,
banner: about,
indent: false,
plugins: [
terser({
compress: {}
}),
],
},
{
file: 'dist/js/cxcalendar.es.js',
format: 'es',
banner: about,
indent: false,
},
],
plugins: [
css({
// output: 'css/cxcalendar.css'
output(style) {
writeFileSync('dist/css/cxcalendar.css', new CleanCSS({
format: 'beautify'
}).minify(style).styles);
writeFileSync('dist/css/cxcalendar.min.css', new CleanCSS({
format: 'keep-breaks'
}).minify(style).styles);
}
})
]
};