@vividlemon/vite-plugin-sri

1.2.0 • Public • Published

vite-plugin-sri

@vividlemon/vite-plugin-sri generates the integrity value in the transformIndexHtml hook, and if dynamic imports are used in the code, the correct integrity cannot be generated. This plugin is designed to solve this problem

Subresource integrity (SRI) plugin for Vite

Adds subresource integrity hashes to script and stylesheet imports from your index.html file at build time

Install

npmp i --D @vividlemon/vite-plugin-sri

Use

In your vite.config.ts file:

import { defineConfig } from 'vite'
import sri from '@vividlemon/vite-plugin-sri'

export default defineConfig({
  // …
  plugins: [sri()]
})

Package Sidebar

Install

npm i @vividlemon/vite-plugin-sri

Weekly Downloads

426

Version

1.2.0

License

MIT

Unpacked Size

7.81 kB

Total Files

8

Last publish

Collaborators

  • vividlemon