forked from patrickp-rthinfo/leaflet-color-markers
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
57 lines (51 loc) · 1.33 KB
/
rollup.config.js
File metadata and controls
57 lines (51 loc) · 1.33 KB
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
/*
note: "circular reference in leaflet" warning is harmless because that is how leaflet was made; ref https://github.com/Leaflet/Leaflet/issues/5968
*/
import nodeResolve from "@rollup/plugin-node-resolve";
import json from "@rollup/plugin-json";
import typescript from '@rollup/plugin-typescript';
import commonjs from "@rollup/plugin-commonjs";
import { dts } from "rollup-plugin-dts";
import url from "@rollup/plugin-url";
export default [{
// build the code bundle
input: 'src/index.ts',
output: [
{
file: 'dist/index.js',
format: 'es',
sourcemap: true,
}
],
onwarn(warning, warn) {
if (warning.code === 'CIRCULAR_DEPENDENCY') {
// Leaflet 1 is constructed circularly, this is normal
return;
}
warn(warning);
},
plugins: [
nodeResolve({
jsnext: true,
main: true,
}),
json(),
typescript(),
// requried to correctly understand Leaflet legacy exporting/class syntax
commonjs(),
// required to correctly bundle the svgs
url(),
]
}, {
// build the types bundle
input: "dist/index.d.ts",
output: [
{
file: "dist/types.d.ts",
format: "es",
}
],
plugins: [
dts(),
]
}];