Vite Plugin for adding a Content Security Policy to your Vite application using the Node.js runtime.
See docs here.
- ✨ Automatically calculates Subresource Integrity (SRI) hashes of JavaScript and CSS assets and adds them to the CSP.
- 📚 Automatically detects and handles Google Fonts.
- 🏎 Single dependency. Uses
@miniflare/html-rewriter
, a WASM build of Cloudflare's HTMLRewriter for parsing HTML.
npm i -D vite-plugin-node-csp