AlpacaTravel / react-map-gl-alt

React Mapbox-GL-JS binding with improved performance, event and API exposure
Other
42 stars 2 forks source link

Require the .dist mapbox gl js directly to minimise webpack configuration #3

Open cammanderson opened 7 years ago

cammanderson commented 7 years ago

Mapbox no longer encourage building of mapbox gl js using webpack. They suggest that their supplied dist version should be directly required.

Examples of the webpack configuration here use alias to map the library to the dist file as needed. This became a "gotcha" (as in issue #2 which could be made smoother.

Update to require the dist file in source completely, minimising the need to set noParse and alias configurations in webpack.

cammanderson commented 7 years ago

A consideration for implementing this at the library level is that it locks the build approach to only using the supplied dist file - which is necessary for systemjs and webpack, but not necessary for browserify. Making this change would stop browserify being able to build.