Use Partytown to move scripts into a web worker in your Astro project
docs.astro.build/en/guides/integrations-guide/partytown/
withastro/astro
Latest: 2.1.4
8 months ago