From e042aa3222b39b6d264ca092f88b9192812b6ddc Mon Sep 17 00:00:00 2001 From: gioboa Date: Sun, 4 Feb 2024 22:47:03 +0100 Subject: [PATCH] docs: add Solid integration --- docs/solid.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 docs/solid.md diff --git a/docs/solid.md b/docs/solid.md new file mode 100644 index 00000000..0fbc082f --- /dev/null +++ b/docs/solid.md @@ -0,0 +1,50 @@ +--- +title: Solid +--- + +To setup Partytown in an Solid project take the following steps. + +## Installation + +Use your favorite package manager to install `@builder.io/partytown` dependency and +copy the Partytown files to the local filesystem using the Vite plugin. +Adopting [this strategy](https://partytown.builder.io/copy-library-files#vite) from the Partytown + Vite docs: + +```js +// vite.config.js +[...] +import { join } from 'path'; +import { partytownVite } from '@builder.io/partytown/utils'; + +export default defineConfig({ + plugins: [ + [...] + partytownVite({ + dest: join(__dirname, 'dist', '~partytown'), + }), + ], + [...] +}); +``` + +## Script Setup + +The snippet below shows you how to setup Partytown scripts in your `index.html` file. The first script tag takes the Partytown [configuration](/configuration). The second script tag references the Partytown JS file and the third file takes the third-party scripts to be loaded on the web-worker. + +```html + + + + + + + + +```