forked from ljagis/leaflet-measure
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
40 lines (37 loc) · 902 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
import html from 'rollup-plugin-html';
import buble from 'rollup-plugin-buble';
import uglify from 'rollup-plugin-uglify';
import serve from 'rollup-plugin-serve';
import livereload from 'rollup-plugin-livereload';
import copy from 'rollup-plugin-copy';
const dev = !!process.env.ROLLUP_WATCH;
const globals = {
leaflet: 'L',
'@turf/area': 'turf.area',
'@turf/length': 'turf.length',
'lodash/template': '_.template',
};
const external = Object.keys(globals);
export default {
input: 'src/index.js',
output: {
file: 'dist/leaflet-measure.js',
format: 'umd',
name: 'leafletMeasure',
globals,
sourcemap: true,
},
external,
plugins: [
html(),
buble(),
!dev && uglify(),
dev && serve('.'),
dev && livereload(),
copy({
'src/assets': 'dist/assets',
'src/styles.css': 'dist/leaflet-measure.css',
verbose: true,
}),
],
};