-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.config.js
More file actions
35 lines (33 loc) · 835 Bytes
/
rollup.config.js
File metadata and controls
35 lines (33 loc) · 835 Bytes
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
import banner from 'rollup-plugin-banner';
import { terser } from "rollup-plugin-terser";
import resolve from '@rollup/plugin-node-resolve';
import pkg from './package.json';
const BannerStr =
`<%= pkg.name %> v<%= pkg.version %>
(c) 2014-${new Date().getFullYear()} by <%= pkg.author %>
Released under the MIT License.`
export default [{
input: 'dist/index.js',
plugins: [resolve()],
output: [{
file: 'dist/draggable.min.js',
format: 'umd',
name: 'Draggable',
plugins: [
terser({
output: {
comments: function (node, comment) {
const { value, type } = comment;
if (type == "comment2") {
return /license/i.test(value);
}
}
}
}),
banner(BannerStr)
]
}, {
file: pkg.main,
format: 'cjs'
}]
}];