mapbox / mapbox-gl-language

Switch language of your Mapbox GL JS style
https://mapbox.github.io/mapbox-gl-language/
BSD 3-Clause "New" or "Revised" License
198 stars 51 forks source link

Wrong typings for ESM module #65

Open raviqqe opened 3 months ago

raviqqe commented 3 months ago

Problem

TypeScript with ESM modules fails to compile a program importing this @mapbox/mapbox-gl-language package.

import language from "@mapbox/mapbox-gl-language";

// This `default` property is `undefined`.
console.log(language.default);
// This `language` default export is the actual constructor. But this leads to a compile error.
const control = new language();

References