diff --git a/bin/release b/bin/release index 354af6a..8480822 100755 --- a/bin/release +++ b/bin/release @@ -412,7 +412,7 @@ def add_libs(rel_name, galette_archive): if os.path.exists(target): os.remove(target) - for todrop in ['.github', 'bin', 'node_modules', 'tests']: + for todrop in ['.github', 'bin', 'build', 'node_modules', 'tests']: target = os.path.join(npm_dir, todrop) if os.path.exists(target): shutil.rmtree(target) diff --git a/build/leaflet-global.js b/build/leaflet-global.js new file mode 100644 index 0000000..4350f2f --- /dev/null +++ b/build/leaflet-global.js @@ -0,0 +1,10 @@ +/** + * This file is part of Galette Maps plugin (https://galette.eu). + * SPDX-FileCopyrightText: Copyright © 2012-2026 The Galette Team + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +// Leaflet is already loaded by maps-main.bundle.min.js; hand the bundler that +// instance instead of a second copy, or the plugin would extend a Leaflet the +// page never sees. +module.exports = window.L; diff --git a/build/maps-gl.js b/build/maps-gl.js new file mode 100644 index 0000000..504b395 --- /dev/null +++ b/build/maps-gl.js @@ -0,0 +1,19 @@ +/** + * This file is part of Galette Maps plugin (https://galette.eu). + * SPDX-FileCopyrightText: Copyright © 2012-2026 The Galette Team + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import * as maplibregl from 'maplibre-gl'; +// Registers L.maplibreGL on the Leaflet the page already loaded (see the +// `leaflet` alias in gulpfile.js). +import '@maplibre/maplibre-gl-leaflet'; + +// The worker is shipped next to this bundle; derive its URL from our own +//