forked from maptalks/maptalks.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
49 lines (46 loc) · 1.41 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
const commonjs = require('rollup-plugin-commonjs'),
resolve = require('rollup-plugin-node-resolve'),
babel = require('rollup-plugin-babel');
const pkg = require('./package.json');
const testing = process.env.BUILD === 'test';
const plugins = testing ?
[
['istanbul', {
// TileLayerGLRenderer is not testable on CI
exclude: ['test/**/*.js', 'src/core/mapbox/*.js', 'src/util/dom.js', 'src/renderer/layer/tilelayer/TileLayerGLRenderer.js', 'src/renderer/layer/ImageGLRenderable.js', 'node_modules/**/*']
}]]
:
[];
const year = new Date().getFullYear();
const banner = `/*!\n * ${pkg.name} v${pkg.version}\n * LICENSE : ${pkg.license}\n * (c) 2016-${year} maptalks.org\n */`;
const outro = `typeof console !== 'undefined' && console.log && console.log('${pkg.name} v${pkg.version}');`;
module.exports = {
input: 'src/index.js',
plugins: [
resolve({
module : true,
jsnext : true,
main : true
}),
commonjs(),
babel({
plugins
})
],
output: [
{
'sourcemap': testing ? 'inline' : false,
'format': 'umd',
'name': 'maptalks',
banner,
outro,
'file': pkg.main
},
{
'sourcemap': false,
'format': 'es',
banner,
'file': pkg.module
}
]
};