Skip to content

Commit

Permalink
Fix: Mapbox Transpilation v2 Issue (Webpack)
Browse files Browse the repository at this point in the history
- Avoid improper transpilation by babel.
- See mapbox/mapbox-gl-js#10565
  • Loading branch information
mkysft committed Oct 1, 2021
1 parent ef880b1 commit be82068
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Map/Map.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useRef, useEffect } from "react";
import styled from "styled-components";
import mapboxgl from "mapbox-gl";
// eslint-disable-next-line import/no-webpack-loader-syntax
import mapboxgl from "!mapbox-gl";
import MapProps from "./Map.types";
import "mapbox-gl/dist/mapbox-gl.css";

Expand Down
6 changes: 6 additions & 0 deletions src/modules/mapbox.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// mapbox.d.ts module definition (put this somewhere in your `src` folder).
declare module '!mapbox-gl' {
export {
default
} from 'mapbox-gl';
}

0 comments on commit be82068

Please sign in to comment.