Skip to content

Commit

Permalink
Rollupify
Browse files Browse the repository at this point in the history
  • Loading branch information
Raruto committed Jun 18, 2019
1 parent 4b1bd4c commit 08ebd0e
Show file tree
Hide file tree
Showing 15 changed files with 1,231 additions and 56 deletions.
3 changes: 3 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"esversion": 6
}
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ _For a working example see one of the following demos:_
<script src="https://unpkg.com/leaflet@1.3.4/dist/leaflet.js"></script>
<!-- JSZIP -->
<script src="https://unpkg.com/jszip@3.1.5/dist/jszip.min.js"></script>
<!-- togeojson -->
<script src="https://unpkg.com/@tmcw/togeojson@3.0.0/dist/togeojsons.min.js"></script>
<!-- @tmcw/togeojson -->
<script src="https://unpkg.com/@tmcw/togeojson@3.0.1/dist/togeojsons.min.js"></script>
<!-- geojson-vt -->
<script src="https://unpkg.com/geojson-vt@3.0.0/geojson-vt.js"></script>
<!-- Leaflet-KMZ -->
<script src="https://unpkg.com/leaflet-kmz@latest/libs/KMZParser.js"></script>
<script src="https://unpkg.com/leaflet-kmz@latest/libs/GridLayer.GeoJSON.js"></script>
<script src="https://unpkg.com/leaflet-kmz@latest/dist/leaflet-kmz.js"></script>
...
</head>
```
Expand Down Expand Up @@ -73,7 +72,7 @@ _For a working example see one of the following demos:_

---

**Compatibile with:** leaflet@1.3.4, jszip@3.1.5, togeojson@3.0.0, geojson-vt@3.0.0, leaflet-pointable@0.0.3
**Compatibile with:** leaflet@1.3.4, jszip@3.1.5, @tmcw/togeojson@3.0.1, geojson-vt@3.0.0, leaflet-pointable@0.0.3

---

Expand Down
42 changes: 42 additions & 0 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { terser } from "rollup-plugin-terser";
import resolve from 'rollup-plugin-node-resolve';
import commonJS from 'rollup-plugin-commonjs';

let plugin = require('../package.json');

let input = "src/index.js";
let output = {
file: "dist/" + plugin.name + "-src.js",
format: "umd",
sourcemap: true,
name: plugin.name,
globals: {
'jszip': 'JSZip',
'geojson-vt': 'geojsonvt',
'@tmcw/togeojson': 'toGeoJSON',
}
};

let external = ['jszip', 'geojson-vt', '@tmcw/togeojson', 'leaflet-pointable'];
let plugins = [
resolve(),
commonJS({
include: '../node_modules/**'
})
];

export default [{
input: input,
output: output,
plugins: plugins,
external: external,
},
{
input: input,
output: Object.assign({}, output, {
file: "dist/" + plugin.name + ".js"
}),
plugins: plugins.concat(terser()),
external: external
}
];
Loading

0 comments on commit 08ebd0e

Please sign in to comment.