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, and this Github discussion for more information.
npm i vite-plugin-vercel-skew-protectionAfter installation, you need to import and add the plugin to your Vite configuration. Here's how you can do it:
- Open your Vite configuration file (usually
vite.config.jsorvite.config.ts). - Import the
vite-plugin-vercel-skew-protectionpackage. - Add
vercelSkewProtection()to thepluginsarray in your Vite configuration.
import vercelSkewProtection from 'vite-plugin-vercel-skew-protection';
export default {
plugins: [process.env.VERCEL_SKEW_PROTECTION_ENABLED === '1' && vercelSkewProtection()].filter(Boolean),
};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.
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.
For issues, suggestions, or contributions, please refer to the project's GitHub repository.