Do Shopify apps transpile storefront JS with Babel?

Hi everyone,

Quick question: do you usually transpile storefront/embed JS with Babel for Shopify apps?

I tried using @babel/preset-env to support older browsers, but Babel injects inline helpers (e.g. _asyncToGenerator, _slicedToArray) at top-level scope. Since multiple apps load scripts on the same store, this made me wonder about potential helper name conflicts.

How do you usually handle cross-browser support for embed JS?

Do you avoid Babel helpers, wrap output in IIFE, or rely on another approach?

Would love to hear real-world experience. Thanks!

1 Like

Hey @parker, wrapping output in IIFE would be the recommended approach. We have some best practices here where it’s mentioned:

1 Like

thanks for your answer!

1 Like