Skip to content

Export leaflet version via createBanner#9657

Closed
simon04 wants to merge 1 commit into
Leaflet:mainfrom
simon04:export-version
Closed

Export leaflet version via createBanner#9657
simon04 wants to merge 1 commit into
Leaflet:mainfrom
simon04:export-version

Conversation

@simon04

@simon04 simon04 commented Apr 20, 2025

Copy link
Copy Markdown
Contributor

Replaces package.json import, and rollup-plugin-json, and rollup-plugin-git-version.

Replaces package.json import, and rollup-plugin-json, and rollup-plugin-git-version.
@Falke-Design

Copy link
Copy Markdown
Member

We made Leaflet importable without the need to bundle it. When I understand your changes correctly, the version would be now never be exported in an unbundled import

@Falke-Design

Copy link
Copy Markdown
Member

And the preprocessors will be removed as soon Firefox implements json import

@Falke-Design

Copy link
Copy Markdown
Member

Changing the import to import pkg from '../package.json' with { type: 'json' } causes the entire package.json to end up in the leaflet-src.js as well as leaflet.js bundle.

Is not ideal, that is true

@simon04

simon04 commented Apr 20, 2025

Copy link
Copy Markdown
Contributor Author

When I understand your changes correctly, the version would be now never be exported in an unbundled import

True. Sorry, I did not consider "Leaflet importable without the need to bundle it" for this PR.

L.version is being used, of course: https://github.com/search?q=leaflet+L.version&type=code

What about writing a version.json file during the build process? I'm happy to look into that...

@Falke-Design

Copy link
Copy Markdown
Member

What about writing a version.json file during the build process? I'm happy to look into that...

There should be a better way to do this, but I have no other idea ... How are doing this other repos?

@jonkoops any ideas how we can export the version without including the whole package.json? #9609 (comment)

@simon04

simon04 commented Apr 20, 2025

Copy link
Copy Markdown
Contributor Author

@Falke-Design

Copy link
Copy Markdown
Member

@simon04 okay thank you. Can you prepare something similar?

@simon04

simon04 commented Apr 20, 2025

Copy link
Copy Markdown
Contributor Author

Superseded by #9662.

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.

2 participants