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.