diff --git a/.gitignore b/.gitignore index 8b930ba6..7bd8fbf4 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ vite.config.ts.timestamp-* # Local Netlify folder .netlify /static/pagefind +/static/~partytown .env diff --git a/.vscode/ltex.dictionary.en-US.txt b/.vscode/ltex.dictionary.en-US.txt index 86ffd283..cad09a8a 100644 --- a/.vscode/ltex.dictionary.en-US.txt +++ b/.vscode/ltex.dictionary.en-US.txt @@ -112,3 +112,4 @@ Roboto Saira impersonification Partiful +Partytown diff --git a/README.md b/README.md index 32857b94..c906549c 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,10 @@ pnpm run dev # Open http://localhost:37572 ``` +## Debugging + +The website uses the Partytown library, which can clutter network requests in DevTools with entries for `proxytown`. To exclude those requests, you can use the filter `-url:proxytown`. + ## Deployment The contents of the repository are continuously deployed to Netlify. You can track the deployment status [here](https://app.netlify.com/sites/pauseai/deploys). diff --git a/package.json b/package.json index 35fcea9b..ea4f28d9 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "vite": "^5.4.8" }, "dependencies": { + "@builder.io/partytown": "^0.10.2", "@fontsource/roboto-slab": "^5.1.0", "@fontsource/saira-condensed": "^5.1.0", "@pagefind/default-ui": "^1.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 30eb9dbb..548055df 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,9 @@ importers: .: dependencies: - '@fontsource-variable/aleo': - specifier: ^5.1.0 - version: 5.1.0 + '@builder.io/partytown': + specifier: ^0.10.2 + version: 0.10.2 '@fontsource/roboto-slab': specifier: ^5.1.0 version: 5.1.0 @@ -142,6 +142,11 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} + '@builder.io/partytown@0.10.2': + resolution: {integrity: sha512-A9U+4PREWcS+CCYzKGIPovtGB/PBgnH/8oQyCE6Nr9drDJk6cMPpLQIEajpGPmG9tYF7N3FkRvhXm/AS9+0iKg==} + engines: {node: '>=18.0.0'} + hasBin: true + '@esbuild/aix-ppc64@0.21.5': resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} engines: {node: '>=12'} @@ -442,9 +447,6 @@ packages: resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@fontsource-variable/aleo@5.1.0': - resolution: {integrity: sha512-c/rpVjaKO1TvP2Js8GWhNcqjn/L4CPus6RrYjQjsVuqnFOJhiw+VYeR1Axgvg6T2wBKEBLRN5UyFHbMpwK/DHA==} - '@fontsource/roboto-slab@5.1.0': resolution: {integrity: sha512-qLqqRm5nwNVgxcfkwL7loyCZr5R5ZR0Vo5vZFgem+zrSKdufB8zQAcOFR3i3ZGnFjuQc2izWSXheY8FSqJ8UoQ==} @@ -1923,6 +1925,8 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 + '@builder.io/partytown@0.10.2': {} + '@esbuild/aix-ppc64@0.21.5': optional: true @@ -2087,8 +2091,6 @@ snapshots: '@eslint/js@8.57.1': {} - '@fontsource-variable/aleo@5.1.0': {} - '@fontsource/roboto-slab@5.1.0': {} '@fontsource/saira-condensed@5.1.0': {} diff --git a/src/app.html b/src/app.html index e0123a1d..19b69c8f 100644 --- a/src/app.html +++ b/src/app.html @@ -1,38 +1,40 @@ - - - - - - - - - - - - - - %sveltekit.head% - - - -
%sveltekit.body%
- - + + + + + + + + + + + + + %sveltekit.head% + + + +
%sveltekit.body%
+ diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 5cbd5212..a4a6914e 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,6 +1,7 @@ + + + {@html ''} + +

(Top)

diff --git a/vite.config.ts b/vite.config.ts index cf3748aa..a39180ed 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,10 +1,19 @@ +import { partytownVite } from '@builder.io/partytown/utils' +import { join } from 'path' import { sveltekit } from '@sveltejs/kit/vite' const config = { server: { port: 37572 }, - plugins: [sveltekit()] + plugins: [ + // Partytown first because SvelteKit copies /static in same hook + partytownVite({ + // Place in /static as /build is wiped by adapter which always runs last + dest: join(__dirname, 'static', '~partytown') + }), + sveltekit() + ] } export default config