Skip to content

Remove default export from ESM distribution#10029

Merged
jonkoops merged 1 commit into
Leaflet:mainfrom
jonkoops:no-default-export
Dec 29, 2025
Merged

Remove default export from ESM distribution#10029
jonkoops merged 1 commit into
Leaflet:mainfrom
jonkoops:no-default-export

Conversation

@jonkoops

@jonkoops jonkoops commented Dec 25, 2025

Copy link
Copy Markdown
Collaborator

Removes the default L export from the ESM distribution, opting for named exports only. This makes it easier to tree-shake code that is imported from the package in the future. This also freezes the ESM distribution, so exported modules cannot be modified, which is expected for modules, and prevents side effects from being introduced by external code.

The UMD distribution is unaffected, and still allows external code to modify the L namespace and its members, and still exposes the L global.

This PR is a split off from #10027 and #9880.

Signed-off-by: Jon Koops <jonkoops@gmail.com>
@jonkoops

Copy link
Copy Markdown
Collaborator Author

@Leaflet/core @Leaflet/leaflet-maintainers could I get a review for this one so I can continue fixing up the build?

@jonkoops

jonkoops commented Dec 29, 2025

Copy link
Copy Markdown
Collaborator Author

I am going to bypass the review and just get this in, I want to start making some progress on the last impediments here. If there are any latent comments, do let me know, and I will address them in a separate PR.

@jonkoops jonkoops merged commit e3a1ce1 into Leaflet:main Dec 29, 2025
16 checks passed
@jonkoops jonkoops deleted the no-default-export branch December 29, 2025 12:07
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

Successfully merging this pull request may close these issues.

1 participant