You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Import repo: import MapboxCircle from 'mapbox-gl-circle';
Summary:
Run Webpack to build the codebase with Webpack's UglifyJsPlugin on. Webpack is attempting to minify all the files in the codebase, but cannot handle ES6 code, resulting in an error.
Error: ERROR in <file>.js from UglifyJs Unexpected token: name (MapboxCircle)
Workaround: import MapboxCircle from 'mapbox-gl-circle/dist/mapbox-gl-circle.min.js'
Importing the minified file seems to be an acceptable workaround for the time being.
Solution:
I don't believe this is limited to Webpack. I'm guessing any minification would result in this error. ES6 code could still cause errors in older browsers as well if not transpiled to ES5. It would be nice if the main file for importing was transpiled to ES5 so that it could be imported as mapbox-gl-circle; building and minifying would work well and unbuilt/unminified code could be assumed to work in older browsers.
The text was updated successfully, but these errors were encountered:
Import repo:
import MapboxCircle from 'mapbox-gl-circle';
Summary:
Run Webpack to build the codebase with Webpack's
UglifyJsPlugin
on. Webpack is attempting to minify all the files in the codebase, but cannot handle ES6 code, resulting in an error.Error:
ERROR in <file>.js from UglifyJs Unexpected token: name (MapboxCircle)
Workaround:
import MapboxCircle from 'mapbox-gl-circle/dist/mapbox-gl-circle.min.js'
Importing the minified file seems to be an acceptable workaround for the time being.
Solution:
I don't believe this is limited to Webpack. I'm guessing any minification would result in this error. ES6 code could still cause errors in older browsers as well if not transpiled to ES5. It would be nice if the main file for importing was transpiled to ES5 so that it could be imported as
mapbox-gl-circle
; building and minifying would work well and unbuilt/unminified code could be assumed to work in older browsers.The text was updated successfully, but these errors were encountered: