0.0.1 ā€¢ Published 8 months ago

vercel-skew-protection v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Vercel Skew Protection

npm version Codecov

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.config.ts
import SkewProtection from "vercel-skew-protection/vite";

export default defineConfig({
  plugins: [SkewProtection()],
});

Example: playground/

// rollup.config.js
import SkewProtection from "vercel-skew-protection/rollup";

export default {
  plugins: [SkewProtection()],
};

// webpack.config.js
module.exports = {
  /* ... */
  plugins: [require("vercel-skew-protection/webpack")()],
};

// nuxt.config.js
export default defineNuxtConfig({
  modules: [
    [
      "vercel-skew-protection/nuxt",
      {
        /* options */
      },
    ],
  ],
});

This module works for both Nuxt 2 and Nuxt Vite

// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require("vercel-skew-protection/webpack")({
        /* options */
      }),
    ],
  },
};

// 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.