JSPM

vercel-skew-protection

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q34263F
  • License MIT

Package Exports

  • vercel-skew-protection
  • vercel-skew-protection/esbuild
  • vercel-skew-protection/nuxt
  • vercel-skew-protection/rollup
  • vercel-skew-protection/types
  • vercel-skew-protection/vite
  • vercel-skew-protection/webpack

Readme

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.