forked from benitolopez/hotel-datepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.js
46 lines (40 loc) · 1.03 KB
/
build.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
const rollup = require('rollup');
const buble = require('rollup-plugin-buble');
const uglify = require('rollup-plugin-uglify');
const filesize = require('rollup-plugin-filesize');
const packageInfo = require('./package.json');
const banner = `/*! ${packageInfo.name} ${packageInfo.version} - Copyright 2022 ${packageInfo.author} - ${packageInfo.homepage} - ${packageInfo.license} */`;
rollup.rollup({
entry: 'src/js/hotel-datepicker.js',
plugins: [buble(), filesize()]
}).then(bundle =>
bundle.write({
format: 'iife',
moduleName: 'HotelDatepicker',
banner,
dest: 'dist/js/hotel-datepicker.js'
})
).catch(console.error);
rollup.rollup({
entry: 'src/js/hotel-datepicker.js',
plugins: [
buble(),
uglify({
output: {
comments(node, comment) {
if (comment.type === 'comment2') {
return comment.value[0] === '!';
}
}
}
}),
filesize()
]
}).then(bundle =>
bundle.write({
format: 'iife',
moduleName: 'HotelDatepicker',
banner,
dest: 'dist/js/hotel-datepicker.min.js'
})
).catch(console.error);