Skip to content

Request: please provide ES5 compiled code #725

@mgvarley

Description

@mgvarley

mapbox-gl-js version: 0.42.2
mapbox-gl-draw version: 1.0.4

Steps to Trigger Behavior

  1. Create a new react application using CreateReactApp https://github.com/facebookincubator/create-react-app
  2. npm install mapbox-gl and @mapbox/mapbox-gl-draw
  3. Create bare bones map using sample code for mapbox-gl-draw
  4. Attempt to build. mapbox-gl only works fine and compiles, add mapbox-gl-draw to the mix and it breaks the build:
Creating an optimized production build...
Failed to compile.
 
Failed to minify the code from this file:

        ./node_modules/@mapbox/mapbox-gl-draw/src/modes/index.js:10

Read more here: http://bit.ly/2tRViJ9

Following the link suggests the issue is due to code not published as ES5 on npm, presumably mapbox-gl code is published in this way, would be great if mapbox-gl-draw would follow the same approach:

npm run build fails to minify

Some third-party packages don't compile their code to ES5 before publishing to npm. This often causes problems in the ecosystem because neither browsers (except for most modern versions) nor some tools currently support all ES6 features. We recommend to publish code on npm as ES5 at least for a few more years.

To resolve this:
Open an issue on the dependency's issue tracker and ask that the package be published pre-compiled.

Expected Behavior

A clean build when including @mapbox/mapbox-gl-draw in a project that uses create-react-app and/or UglifyJS

Actual Behavior

Including @mapbox/mapbox-gl-draw breaks the build. Just including mapbox-gl works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions