GeoTIFF / georaster-layer-for-leaflet

Display GeoTIFFs and soon other types of raster on your Leaflet Map
https://geotiff.github.io/georaster-layer-for-leaflet-example/
Apache License 2.0
306 stars 58 forks source link

Packaging and distribution #93

Open rowanwins opened 2 years ago

rowanwins commented 2 years ago

Describe the bug Currently the georaster-layer-for-leaflet package points to the minified file which includes pretty much all the dependencies (eg proj4, chromajs etc).

https://github.com/GeoTIFF/georaster-layer-for-leaflet/blob/1b05e990ac333ae4f447a01dfe46da569b1eacaf/package.json#L5-L8

The minified files are handy for distributing a single file via a CDN. But it's not so good when importing packages which is how the bulk of apps are built these days - I think it's resulting in duplicate copies of libraries being included in an app because they won't be properly tree-shaken.

What I think needs to happen in the package.json is something like

  "source": "src/georaster-layer-for-leaflet.ts", <--- although I think perhaps this needs culling
  "main": "dist/georaster-layer-for-leaflet.bundle.js",
  "module": "dist/georaster-layer-for-leaflet.js",
  "type": "module",
  "unpkg": "dist/georaster-layer-for-leaflet.min.js",

This should make for better usage downstream 🤞 .