Skip to content

Commit

Permalink
docs: note about partytown-sandbox-sw.html
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley authored Mar 23, 2022
1 parent 520a5de commit 3dcf59d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ The `lib` directory contains the static files that should be hosted from the sam

The `partytown.js` file must be in the `<head>` before all other third-party scripts, and should _not_ have the `async` or `defer` attributes. Because the script must be executed immediately, and since it's such a small file, it's always preferred to inline the `partytown.js` script content, rather than it being an additional http request.

> Note: When the service worker is correctly installed, the service worker itself handles the request to the `partytown-sandbox-sw.html` file and provides the content. The network tab will show `partytown-sandbox-sw.html`, and the service worker provides the response, but the file itself is not in the distribution. If you receive a 404 for this file then it means the service worker is not installed correctly. Please try uninstalling any existing Partytown service workers and ensure the Partytown files are loading correctly.
### `lib/debug/`

The `lib/debug` directory has the same purpose as the `lib`, but instead will console log more information and the files themselves are not minified. Additionally, you'll notice there are more debug files than the production lib files, and that's because the production lib files inline many scripts. For example, the web worker script is inlined, rather than being a separate request.
Expand Down

1 comment on commit 3dcf59d

@vercel
Copy link

@vercel vercel bot commented on 3dcf59d Mar 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.