forked from GIScience/Leaflet.Heightgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
47 lines (45 loc) · 1.28 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
import nodeResolve from '@rollup/plugin-node-resolve'
import {terser} from 'rollup-plugin-terser'
import babel from '@rollup/plugin-babel'
import css from 'rollup-plugin-css-porter'
import copy from 'rollup-plugin-copy'
// noinspection JSUnusedGlobalSymbols
export default {
input: 'src/L.Control.Heightgraph.js',
output: [
{
file: 'dist/L.Control.Heightgraph.js',
format: 'cjs'
},
{
file: 'dist/L.Control.Heightgraph.min.js',
format: 'iife',
name: 'version',
plugins: [terser()]
}
],
plugins: [
nodeResolve({
mainFields: ['module','jsnext', 'main']
}),
babel({
exclude: "node_modules/**", // only transpile our source code
babelHelpers: 'bundled'
}),
css({
raw: 'dist/L.Control.Heightgraph.css',
minified: 'dist/L.Control.Heightgraph.min.css'
}),
copy({
targets: [
{ src: 'src/img/**/*', dest: 'dist/img'}
]
})
],
external: ['leaflet'],
// see e.g. https://github.com/rollup/rollup/issues/2271
onwarn (warning, warn) {
if (warning.code === 'CIRCULAR_DEPENDENCY') return;
warn(warning);
}
};