#Transpiling client JavaScript to versions earlier than ES2018

6 messages · Page 1 of 1 (latest)

steel vine
#

I'm developing a web with compatibility with legacy browsers in mind, but I've been having issues with Astro islands because they're using modern JS syntax.
So far the only way I've been able to change the target JavaScript version is in the Vite configuration:

export default defineConfig({
  vite: {
    build: {
      target: "es2018"
    }
  }
})

But I can't transpile for versions below ES2018. From what I've seen, it seems like this controls the transpiling for the Astro framework as a whole (including things like Astro islands and SSR).
I wish to be able to transpile only the client-side JavaScript. That is, everything in the <script> tags within Astro pages and components, and if possible, Astro islands for Svelte components.

west helm
steel vine
#

Yes, mainly IE11 to IE9

west helm
#

Astro doesn't support IE11

steel vine
#

I see, then it seems like the only way to do it is with <script is:inline>...