Supporting Safari (ES5) with Rails JS bundling/eslint
This blog post was originally published a little while ago. Please consider that it may no longer be relevant or even accurate.
I recently replaced Webpacker v6 in a Rails app with the new standard of
jsbundling-rails using eslint. Turned out to be a lucky change as well considering that Rails have abandoned Webpacker without shipping a v6.0 release.
Luckily, esbuild has an option called
target which allows you to specify browser vendors/version combinations that need to be supported. I suppose this is similar to browserlist (which Webpacker used). This makes it easy to add support for Safari 13 back with just
--target=safari13 in the