Hmmmm. everything seemed just fine to me. I did some troubleshooting and the issue looked like it was being caused by Mapbox. How could this be? It was not a problem locally.
I found the answer here: Build fails when using mapbox-gl webpack 2 and UglifyJSPlugin #4359.
Credit really goes to zezhipeng – whose answer was spot-on. Seems that when Webpack parses the mapbox-gl module, things do not go too well. So I just needed to add this line to my Webpack config:
(the “…” is just whatever else you have in your module.exports.module object.)
And that was it, working again. Thanks zezhipeng!