My process involves using the command:
yarn add --dev @types/mapbox-gl @types/geojson
This successfully adds mapbox and geojson to my project. I can see them when attempting to import mapboxgl.
Next, I create something similar to this:
import * as L from 'mapbox-gl';
export class MapBuilder
{
build(): void {
let map = new L.Map({
container: 'mapContainer',
style: this.map.getStyle()
//etc
});
}
}
However, running yarn build results in the following message:
This dependency was not found:
- mapbox-gl in ./assets/js/MapBuilder.ts