This change eliminates all external CDN dependencies by bundling JavaScript libraries locally using esbuild. All vendor files are now served from the application's own assets, improving reliability and privacy. Changes: - Created assets/js/vendor.js to bundle all external libraries - Added vendor bundle configuration to esbuild in config files - Updated all templates to use local vendor.js instead of CDN scripts - Created download-vendor-files.sh script to fetch vendor libraries - Added vendor files to .gitignore (they're downloaded during setup) - Updated CSS imports to include vendor stylesheets - Added vendor build step to assets.deploy mix task Bundled libraries: - Leaflet 1.9.4 (mapping library) - Leaflet.heat 0.2.0 (heatmap plugin) - Leaflet.markercluster 1.5.3 (marker clustering) - OverlappingMarkerSpiderfier 0.2.6 (overlapping marker handling) - Chart.js 4.5.0 (charting library) - chartjs-adapter-date-fns 3.0.0 (date adapter for Chart.js) All functionality tested and working correctly with local bundles. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
23 lines
No EOL
802 B
JavaScript
23 lines
No EOL
802 B
JavaScript
// Vendor libraries bundle
|
|
// This file loads all external libraries and makes them available globally
|
|
|
|
// Load Leaflet first (required by plugins)
|
|
import '../vendor/leaflet.js';
|
|
|
|
// Load Leaflet plugins (they expect window.L to exist)
|
|
import '../vendor/leaflet-heat.js';
|
|
import '../vendor/leaflet.markercluster.js';
|
|
import '../vendor/oms.min.js';
|
|
|
|
// Load Chart.js
|
|
import '../vendor/chart.umd.js';
|
|
|
|
// Load Chart.js adapter (requires Chart to be loaded first)
|
|
import '../vendor/chartjs-adapter-date-fns.bundle.min.js';
|
|
|
|
// Ensure global availability
|
|
if (typeof window !== 'undefined') {
|
|
// Leaflet should already be on window.L from the library
|
|
// Chart should already be on window.Chart from the library
|
|
console.log('Vendor libraries loaded: Leaflet', !!window.L, 'Chart.js', !!window.Chart);
|
|
} |