A simple svelte wrapper for @builder.io/partytown
npm i -D partytown-sveltekit
Partytown requires some scripts to be served by the app and provides a convinience script to achieve this.
npx @builder.io/partytown copylib static/~partytown
npx @builder.io/partytown copylib public/~partytown
- In your layout :
<script>
import PartytownSnippet from 'partytown-sveltekit/PartytownSnippet.svelte'
</script>
<PartytownSnippet />
- To include a third-party script :
<script>
import Partytown from 'partytown-sveltekit/Partytown.svelte'
</script>
<Partytown script="<INLINE THIRD-PARTY SCRIPT>">