Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bitttttten/vite-vlugin-vercel-skew-protection
https://github.com/bitttttten/vite-vlugin-vercel-skew-protection
skew-protection vercel vercel-deployment vite vite-plugin
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/bitttttten/vite-vlugin-vercel-skew-protection
- Owner: bitttttten
- License: other
- Created: 2024-06-25T08:00:26.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-25T08:00:57.000Z (5 months ago)
- Last Synced: 2024-08-01T19:45:43.185Z (3 months ago)
- Topics: skew-protection, vercel, vercel-deployment, vite, vite-plugin
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/vite-plugin-vercel-skew-protection
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- fucking-awesome-vite - vite-vlugin-vercel-skew-protection - Helps configure Vercel Skew Protection. (SSR / Frameworks)
- awesome-vite - vite-vlugin-vercel-skew-protection - Helps configure Vercel Skew Protection. (SSR / Frameworks)
README
# vite-plugin-vercel-skew-protection
This package provides a plugin for Vite to integrate Vercel skew protection into your project. It's designed to help manage and mitigate potential skew issues when deploying applications on Vercel.
See the [Vercel docs](https://vercel.com/docs/deployments/skew-protection), and [this Github discussion](https://github.com/orgs/vercel/discussions/6496) for more information.
## Installation
```sh
npm i vite-plugin-vercel-skew-protection
```## Usage
After installation, you need to import and add the plugin to your Vite configuration. Here's how you can do it:
1. Open your Vite configuration file (usually `vite.config.js` or `vite.config.ts`).
2. Import the `vite-plugin-vercel-skew-protection` package.
3. Add `vercelSkewProtection()` to the `plugins` array in your Vite configuration.### Example Configuration
```js
import vercelSkewProtection from 'vite-plugin-vercel-skew-protection';export default {
plugins: [process.env.VERCEL_SKEW_PROTECTION_ENABLED === '1' && vercelSkewProtection()].filter(Boolean),
};
```## Troubleshooting
This documentation presumes the default Vite configuration settings, or that you haven't tweaked your config too much. It assumes that your static files are being built into the `assets` folder, and that you are using `index.html` as the entry point.
Should your Vite setup deviate from these defaults through customization, the plugin might not function as expected. In such cases, please reach out to see if we can make it work.
## Note
The author of this plugin is not actively using it anymore. However, it has been previously used in many production environments. It's recommended to test the plugin thoroughly in your development environment before deploying it to production.
## Support
For issues, suggestions, or contributions, please refer to the project's GitHub repository.