GeoTIFF/georaster-layer-for-leaflet

Packaging and distribution

rowanwins opened this issue · 0 comments

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).

"source": "src/georaster-layer-for-leaflet.ts",
"main": "dist/georaster-layer-for-leaflet.min.js",
"unpkg": "dist/georaster-layer-for-leaflet.min.js",
"types": "dist/georaster-layer-for-leaflet.d.ts",

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 🤞 .