vercel-skew-protection
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

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

Package Sidebar

Install

npm i vercel-skew-protection

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

45.9 kB

Total Files

34

Last publish

Collaborators

  • ryoid