Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging and distribution #93

Open
rowanwins opened this issue Apr 13, 2022 · 0 comments
Open

Packaging and distribution #93

rowanwins opened this issue Apr 13, 2022 · 0 comments

Comments

@rowanwins
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant