0.6.3 • Published 11 months ago

vite-plugin-hash-csp v0.6.3

Weekly downloads
-
License
GPL-3.0-only
Repository
github
Last release
11 months ago

Vite Plugin Hash CSP

This package has moved to vite-plugin-csp-guard

Documentation

Full documentation and helpful guides are available here.

Installation

npm install -D vite-plugin-hash-csp
# or
yarn add -D vite-plugin-hash-csp
# or
pnpm add -D vite-plugin-hash-csp

Basic Usage

// vite.config.ts
import { defineConfig } from "vite";
import csp from "vite-plugin-hash-csp";

export default defineConfig({
  plugins: [
    csp({
      algorithm: "sha256", // The algorithm to use for hashing
      dev: {
        run: true, // If you want to run the plugin in `vite dev` mode
      },
      policy: {
        // Specify the policy here.
        "script-src": ["'self'", "https://www.google-analytics.com"], // Example: Allow Google Analytics
        "style-src": ["'self'", "https://fonts.googleapis.com"], // Example: Allow Google Fonts
      },
    }),
  ],
});
0.6.3

11 months ago

0.6.2

11 months ago

0.6.1

12 months ago

0.6.0

12 months ago

0.5.0

12 months ago

0.4.0

12 months ago

0.3.0

12 months ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago