Skip to content

Tree Shaking

@gebeta/js is fully tree-shakeable. Import only what you need to keep your bundle small.

Subpath imports

Instead of importing everything:

js
// Pulls in the full SDK (~300 kB)
import { GeocodingManager } from '@gebeta/js';

Use a subpath import instead:

js
// Only geocoding (~45 kB)
import { GeocodingManager } from '@gebeta/js/geocoding';

// Only directions
import { DirectionsManager } from '@gebeta/js/directions';

// Only clustering
import { ClusteringManager } from '@gebeta/js/clustering';

// Only navigation
import { NavigationManager } from '@gebeta/js/navigation';

// Only fencing
import { FenceManager } from '@gebeta/js/fencing';

Available subpaths

ImportIncludes
@gebeta/jsEverything
@gebeta/js/geocodingGeocodingManager + AuthManager
@gebeta/js/directionsDirectionsManager + AuthManager
@gebeta/js/clusteringClusteringManager + AuthManager
@gebeta/js/navigationNavigationManager + AuthManager
@gebeta/js/fencingFenceManager + AuthManager

Auditing your bundle

Run the bundle analyzer from the repo root:

bash
yarn bundle:audit <workspace-name>

This opens an interactive treemap showing exactly which modules are included and their sizes.