vite-plugin-sri4

JSON →
library 4.0.0 ·javascript
verified Jun 4, 2026

Vite plugin (v4.0.0) that automatically generates Subresource Integrity (SRI) hashes for JavaScript and CSS assets during build, injecting integrity and crossorigin attributes into HTML. Supports configurable hash algorithms (sha256/sha384/sha512), domain bypassing, and custom log levels. Compatible with Vite 7 and 8 (including Rolldown). Active development, MIT license. Differentiators: CORS support check for external resources, robust content type handling (string/Buffer/Uint8Array), and debug logging. Alternative to rollup-plugin-sri with tighter Vite integration.