-
Notifications
You must be signed in to change notification settings - Fork 8
/
rollup.config.js
48 lines (44 loc) · 1.35 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
const { nodeResolve } = require('@rollup/plugin-node-resolve');
const commonjs = require('@rollup/plugin-commonjs');
const pkg = require('./package.json');
const terser = require('@rollup/plugin-terser');
const sourcemaps = require('rollup-plugin-sourcemaps');
const outputFile = pkg.main;
const banner = `/*!\n * ${pkg.name} v${pkg.version}\n * LICENSE : ${pkg.license}\n * (c) 2016-${new Date().getFullYear()} maptalks.com\n */`;
let outro = pkg.name + ' v' + pkg.version;
outro = `typeof console !== 'undefined' && console.log('${outro}');`;
module.exports = [
{
input: './index.js',
plugins: [
nodeResolve({
module: true,
// jsnext : true,
main: true
}),
commonjs(),
sourcemaps(),
terser({
mangle: false,
compress: {
pure_getters: true
},
output: {
ecma: 2017,
// keep_quoted_props: true,
beautify: false,
comments: '/^!/'
}
})
],
output: {
sourcemap: true,
banner,
outro,
extend: true,
name: 'maptalks',
file: outputFile,
format: 'umd'
}
}
];