Skip to content

Commit

Permalink
add migration docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsotne Gvadzabia committed Dec 28, 2024
1 parent 0c0bb3b commit 91477a3
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 8 deletions.
4 changes: 4 additions & 0 deletions apps/docs/pages/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"title": "Guides",
"href": "/guides"
},
"migrations": {
"title": "Migrations",
"href": "/migrations"
},
"api-docs": {
"title": "API",
"href": "/api-docs"
Expand Down
10 changes: 5 additions & 5 deletions apps/docs/pages/api-docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,17 @@ You can read our guide for creating a policy [here](/guides/policy)

### build
- Type: `object`
- Default: `{hash: false}`
- Default: `{sri: false}`
- Description: Options that apply only when running `vite build`.

<Tabs items={['hash']} defaultIndex="0">
<Tabs items={['sri']} defaultIndex="0">
<Tabs.Tab>
### `hash`
### `sri`
- **Type:** `boolean`
- **Default:** `false`
- **Description:** Determines if the plugin should hash the applications code during the build process.
- **Description:** Determines if the plugin should hash the JS code during the build process.
<Callout type="info">
The reason this is set to false by default is because you might not need to hash your applications JS code for production. Inline scripts inside your `index.html` are hashed regardless of this setting.
Read more about [SRI here](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity)
</Callout>
</Tabs.Tab>
</Tabs>
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/pages/index.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

# Vite Plugin CSP Guard
Introducing the **Vite Plugin CSP Guard**, your ultimate solution for effortlessly implementing a Content Security Policy (CSP) in your Vite-powered Single Page Application (SPA). CSPs are crucial for protecting your site against XSS attacks, but setting them up correctly can be complex and time-consuming. Our plugin eliminates these challenges with a straightforward, effective approach.
Simplify CSP setup for your Vite SPA with Vite Plugin CSP Guard! Say goodbye to the hassle of managing Content Security Policies and hello to an easy way to protect your app from XSS attacks.

## Why Choose Vite Plugin CSP Guard?

- **Effortless Integration**: Simply declare your CSP inside your `vite.config.ts` file and you're ready to go. No complex setup, no hassle.
- **Automated Hashing**: Unlike traditional methods that rely on nonces (which aren't feasible for SPAs), we support hashing.
- **Real-Time CSP Validation**: Avoid the risk of shipping code that gets blocked in production. Our plugin runs your CSP in Vite dev mode, providing immediate feedback and ensuring your CSP policies are correct before deployment.
- **Good DX**: Avoid the risk of shipping code that gets blocked in production. Our plugin runs your CSP in Vite dev mode.
- **[SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) Support**: More security for the code you ship
- **Designed for SPAs**: Tailored specifically for Single Page Applications, our plugin addresses the unique challenges they present.

## Supported Technologies
Expand Down
6 changes: 6 additions & 0 deletions apps/docs/pages/migrations/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"v2": {
"title": "V2",
"href": "/migrations/v2"
}
}
12 changes: 12 additions & 0 deletions apps/docs/pages/migrations/v2.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Upgrade to V2

## Key changes:

- Support for Vite 6
- Full support for [SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity)


## Required changes

Stop using `build.hash` inside your `vite.config.ts` this has been removed.
Its instead been replaced by `build.sri`

0 comments on commit 91477a3

Please # to comment.