Vercel Skew Protection
Bringing Vercel's Skew Protection beyond Nextjs with a Vite plugin.
🚧 Currently only tested with Solidjs (SolidStart) on Vite.
Based on original experimentation, also check out the accompanying initial blog post to learn how this works.
Install
npm i vercel-skew-protection
Vite
// vite.config.ts
import SkewProtection from "vercel-skew-protection/vite";
export default defineConfig({
plugins: [SkewProtection()],
});
Example: playground/
Rollup
// rollup.config.js
import SkewProtection from "vercel-skew-protection/rollup";
export default {
plugins: [SkewProtection()],
};
Webpack
// webpack.config.js
module.exports = {
/* ... */
plugins: [require("vercel-skew-protection/webpack")()],
};
Nuxt
// nuxt.config.js
export default defineNuxtConfig({
modules: [
[
"vercel-skew-protection/nuxt",
{
/* options */
},
],
],
});
This module works for both Nuxt 2 and Nuxt Vite
Vue CLI
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require("vercel-skew-protection/webpack")({
/* options */
}),
],
},
};
esbuild
// esbuild.config.js
import { build } from "esbuild";
import SkewProtection from "vercel-skew-protection/esbuild";
build({
plugins: [SkewProtection()],
});
Development
- Clone this repository
- Install dependencies using
pnpm install
- Run interactive tests using
pnpm play
License
Published under MIT License.