-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathrollup.config.js
55 lines (52 loc) · 1.54 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
50
51
52
53
54
55
const resolve = require('rollup-plugin-node-resolve');
const babel = require('rollup-plugin-babel');
const commonjs = require('rollup-plugin-commonjs');
const uglify = require('rollup-plugin-uglify').uglify;
const pkg = require('./package.json');
const production = process.env.BUILD === 'production';
const outputFile = production ? 'dist/maptalks.deck.js' : 'dist/maptalks.deck-dev.js';
const plugins = production ? [
uglify({
mangle: {
properties: {
'regex' : /^_/,
'keep_quoted' : true
}
}
})] : [];
const banner = `/*!\n * ${pkg.name} v${pkg.version}\n * LICENSE : ${pkg.license}\n * (c) 2016-${new Date().getFullYear()} maptalks.org\n */`;
module.exports = {
input: 'src/index.js',
plugins: [
resolve({
module : true,
jsnext : true,
main : true
}),
commonjs(),
babel({
exclude: 'node_modules/**'
})
].concat(plugins),
external : ['maptalks', '@deck.gl/core'],
output: [
{
'sourcemap': production ? false : 'inline',
'format': 'umd',
'name': 'maptalks',
'banner': banner,
'extend' : true,
'globals' : {
'maptalks' : 'maptalks',
'@deck.gl/core' : 'deck'
},
'file': outputFile
}/* ,
{
'sourcemap': false,
'format': 'es',
'banner': banner,
'file': pkg.module
} */
]
};