-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
rollup.config.js
98 lines (95 loc) · 1.84 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import buble from 'rollup-plugin-buble';
import { terser } from "rollup-plugin-terser";
import { version, author, license, description, name } from './package.json';
import fs from 'fs';
const moduleName = 'greinerHormann';
const banner = `\
/**
* ${name} v${version}
* ${description}
*
* @author ${author}
* @license ${license}
* @preserve
*/
`;
module.exports = [{
input: 'src/index.js',
output: {
file: `dist/${name}.js`,
name: moduleName,
sourcemap: true,
format: 'umd',
banner
},
plugins: [
resolve(), // so Rollup can find external libs
commonjs(), // so Rollup can convert commonJS to an ES module
buble()
]
}, {
input: 'src/leaflet.js',
output: {
file: `dist/${name}.leaflet.js`,
name: moduleName,
sourcemap: true,
format: 'umd',
banner
},
plugins: [
resolve(), // so Rollup can find external libs
commonjs(), // so Rollup can convert commonJS to an ES module
buble()
]
}, {
input: `test/js/test.js`,
output: {
file: `test/js/bundle.js`,
name: moduleName,
sourcemap: true,
format: 'iife',
banner,
globals: { 'leaflet': 'L', 'leaflet-draw': 'L.Draw' }
},
plugins: [
buble()
]
}, {
input: `src/index.js`,
output: {
file: `dist/${name}.min.js`,
name: moduleName,
sourcemap: true,
format: 'umd',
banner
},
plugins: [
buble(),
terser({
sourcemap: true,
output: {
comments: 'some'
}
})
]
}, {
input: `src/leaflet.js`,
output: {
file: `dist/${name}.leaflet.min.js`,
name: moduleName,
sourcemap: true,
format: 'umd',
banner
},
plugins: [
buble(),
terser({
sourcemap: true,
output: {
comments: 'some'
}
})
]
}];