-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
41 lines (39 loc) · 924 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
38
39
40
41
// rollup.config.js
import pkg from './package.json';
import ts from 'rollup-plugin-typescript2'
import { terser } from "rollup-plugin-terser";
const banner = `
/**
* ${pkg.name} v${pkg.version}
* @author ${pkg.author}
* @license ${pkg.license}
*/
`;
export default {
input: 'src/uploader.ts',
output: [{
file: pkg.main,
format: 'umd',
name: 'Uploader',
banner,
globals: {
'spark-md5': 'SparkMD5'
}
}, {
file: pkg.module,
format: 'es',
banner,
}],
plugins: [ts(), terser({
output: {
comments: function (node, comment) {
if (comment.type === 'comment2') {
// multiline commenta
return /@preserve|@license/i.test(comment.value);
}
return false;
}
}
})],
external: ['spark-md5']
};