{"_id":"vite-plugin-manifest-sri","_rev":"2-4067a457f5082df27cd6e95e3d8023a9","name":"vite-plugin-manifest-sri","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"vite-plugin-manifest-sri","description":"Subresource Integrity hashes for the Vite.js manifest.","version":"0.1.0","sideEffects":false,"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.js","types":"./dist/index.d.ts"}},"license":"MIT","author":{"name":"Máximo Mussini","email":"maximomussini@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/ElMassimo/vite-plugin-manifest-sri.git"},"homepage":"https://github.com/ElMassimo/vite-plugin-manifest-sri","bugs":{"url":"https://github.com/ElMassimo/vite-plugin-manifest-sri/issues"},"keywords":["sri","security","subresource integrity","build","vite","vite-plugin","vitejs","plugin"],"devDependencies":{"@mussi/eslint-config":"^0.5","@types/debug":"^4.1","@types/node":"^14.14","conventional-changelog-cli":"^2.2.2","cross-spawn":"^7.0.3","enquirer":"^2.3.6","eslint":"^7.17.0","minimist":"^1.2.5","picocolors":"^1.0.0","rollup":"^2.59","semver":"^7.3.5","tsup":"^5","typescript":"^4.5","vite":"^2.7.0","vitest":"^0.1.0"},"eslintConfig":{"extends":["@mussi/eslint-config"],"globals":{"$ref":"readonly","$computed":"readonly","$shallowRef":"readonly","$$":"readonly","$":"readonly"}},"scripts":{"lint":"eslint .","test":"vitest","dev":"npm run build -- --watch","example":"npm -C example run dev","example:build":"npm -C example run build","example:now":"npm -C example run now","build":"tsup src/index.ts --dts --format cjs,esm --clean","release":"node scripts/release.cjs","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s"},"gitHead":"4cb84e0c1d4c8b0b80623a2c5a25492b92a6057c","_id":"vite-plugin-manifest-sri@0.1.0","_nodeVersion":"16.5.0","_npmVersion":"7.19.1","dist":{"integrity":"sha512-m4gcEXwcA1MfCVYTLVHYsB03Xsc6L4VYfhxXmcYcS+rN3kTjuWkXMaA8OuOV1gFdi1bMJFkLTJCPciYApvCm/g==","shasum":"e2b9d0cebf7c7c307cee8aab3a8b3cf604bca921","tarball":"https://registry.npmjs.org/vite-plugin-manifest-sri/-/vite-plugin-manifest-sri-0.1.0.tgz","fileCount":6,"unpackedSize":10923,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5xQCCRA9TVsSAnZWagAApTgP/RwDNgxtPDHA4KyXFE3Z\nkidQVkye5JyYoyF1kAixIOnMMZho5X3letzU4Y4nRMxj0W+z9QB4FZa9QusQ\nMLLYLGB5tyRa//gVtK7tDglNIlJ6ZzazgHLHlRe+jUll0XV9Rmqk0iD152De\nHicwBEt9BjgrcvPUEScfPggOlRodRw/PWgay9aXBPYbpa/k7b54SeJkfXMCe\nQslLdxYjXdfohwYRBcfia1YVdbYVsaLwYqTPba4PY0yiNALU+/+jc8FTfCil\nxPf+VdkJr3BKuQOEa3yFIvsfFel7lk4on00U1ABq4PXfarKvBNDNHeMdnqGh\nXkTbFTZIbP7bv3gTIKzvGdxBu/awHPBk9/mchx2baIuECmqxEqxdLGo6NBT/\nTS7bBCg/8zpzn0LalGML3oZK8deb1ZSQciuMXmd1Ff4WTxEIDh/YclGOkhRb\n7jr7KiArIYvAEYzD+6UR5N8SdgnmSCCYN/a76Qax8wXnkTVtkyzj5vW9HBje\nZhMXZPtM9Yv//XKSk8IOcph5hKR6t+HXrcGGd3xOs8Ao3uknzBvY6Dxop62g\nsT432lPBRNoe8f62px31J62FvJ7Io4KAYwIYMLunKCN/fBU1xY9hd7NFSaN/\ntsx4kepbHuVVytZLdwn8ToLuoEevkrPsB1V0aL2QzX6oO34u7tj3U573cCsa\nxr2N\r\n=3kgf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3MvY1cfw/NxOww/z0HY8c4HzV/TkjmBQWq1/Cnq4yVgIhAPJ9jMzcfQnEwlWA3hp30YgBHaq/+9WcczjhkYWCD7BV"}]},"_npmUser":{"name":"elmassimo","email":"maximomussini@gmail.com"},"directories":{},"maintainers":[{"name":"elmassimo","email":"maximomussini@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vite-plugin-manifest-sri_0.1.0_1642533889807_0.8061936223082031"},"_hasShrinkwrap":false},"0.2.0":{"name":"vite-plugin-manifest-sri","description":"Subresource Integrity hashes for the Vite.js manifest.","version":"0.2.0","sideEffects":false,"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.js","types":"./dist/index.d.ts"}},"license":"MIT","author":{"name":"Máximo Mussini","email":"maximomussini@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/ElMassimo/vite-plugin-manifest-sri.git"},"homepage":"https://github.com/ElMassimo/vite-plugin-manifest-sri","bugs":{"url":"https://github.com/ElMassimo/vite-plugin-manifest-sri/issues"},"keywords":["sri","security","subresource integrity","build","vite","vite-plugin","vitejs","plugin"],"devDependencies":{"@mussi/eslint-config":"^0.5.1","@types/debug":"^4.1.12","@types/node":"^18.18.9","conventional-changelog-cli":"^2.2.2","cross-spawn":"^7.0.3","enquirer":"^2.4.1","eslint":"^7.32.0","minimist":"^1.2.8","picocolors":"^1.0.0","rollup":"^4.4.1","semver":"^7.5.4","tsup":"^7.2.0","typescript":"^4.9.5","vite":"^5.0.0","vitest":"^0.34"},"eslintConfig":{"extends":["@mussi/eslint-config"],"globals":{"$ref":"readonly","$computed":"readonly","$shallowRef":"readonly","$$":"readonly","$":"readonly"}},"scripts":{"lint":"eslint .","test":"vitest","dev":"npm run build -- --watch","example":"npm -C example run dev","example:build":"npm -C example run build","example:now":"npm -C example run now","build":"tsup src/index.ts --dts --format cjs,esm --clean","release":"node scripts/release.cjs","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s"},"_id":"vite-plugin-manifest-sri@0.2.0","_integrity":"sha512-Zt5jt19xTIJ91LOuQTCtNG7rTFc5OziAjBz2H5NdCGqaOD1nxrWExLhcKW+W4/q8/jOPCg/n5ncYEQmqCxiGQQ==","_resolved":"/private/var/folders/j6/gyvfxjy50jqgy9lth08nd_f40000gn/T/2c5a7fc81d5b56e604f66293ef680ba2/vite-plugin-manifest-sri-0.2.0.tgz","_from":"file:vite-plugin-manifest-sri-0.2.0.tgz","_nodeVersion":"20.8.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-Zt5jt19xTIJ91LOuQTCtNG7rTFc5OziAjBz2H5NdCGqaOD1nxrWExLhcKW+W4/q8/jOPCg/n5ncYEQmqCxiGQQ==","shasum":"cb1cfd11692ee81f5d1194926cbea6d3a38b8599","tarball":"https://registry.npmjs.org/vite-plugin-manifest-sri/-/vite-plugin-manifest-sri-0.2.0.tgz","fileCount":8,"unpackedSize":14551,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOP6AJrW0KE8wasvBVLHTaFMHe3Td2rUvlcNB8gAfq6wIgQDElsoiKSjYHhmxyybvlmuhTqp1A+HmVleDoL/8F30g="}]},"_npmUser":{"name":"elmassimo","email":"maximomussini@gmail.com"},"directories":{},"maintainers":[{"name":"elmassimo","email":"maximomussini@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vite-plugin-manifest-sri_0.2.0_1700162258027_0.1930066201436451"},"_hasShrinkwrap":false}},"time":{"created":"2022-01-18T19:24:49.807Z","0.1.0":"2022-01-18T19:24:50.270Z","modified":"2023-11-16T19:17:38.471Z","0.2.0":"2023-11-16T19:17:38.278Z"},"maintainers":[{"name":"elmassimo","email":"maximomussini@gmail.com"}],"description":"Subresource Integrity hashes for the Vite.js manifest.","homepage":"https://github.com/ElMassimo/vite-plugin-manifest-sri","keywords":["sri","security","subresource integrity","build","vite","vite-plugin","vitejs","plugin"],"repository":{"type":"git","url":"git+https://github.com/ElMassimo/vite-plugin-manifest-sri.git"},"author":{"name":"Máximo Mussini","email":"maximomussini@gmail.com"},"bugs":{"url":"https://github.com/ElMassimo/vite-plugin-manifest-sri/issues"},"license":"MIT","readme":"<h2 align='center'>\n  <samp>vite-plugin-manifest-sri</samp>\n</h2>\n\n<p align='center'>Subresource Integrity for Vite.js Manifests</p>\n\n<p align='center'>\n  <a href='https://www.npmjs.com/package/vite-plugin-manifest-sri'>\n    <img src='https://img.shields.io/npm/v/vite-plugin-manifest-sri?color=222&style=flat-square'>\n  </a>\n  <a href='https://github.com/ElMassimo/vite-plugin-manifest-sri/blob/main/LICENSE.txt'>\n    <img src='https://img.shields.io/badge/license-MIT-blue.svg'>\n  </a>\n</p>\n\n<br>\n\n[Vite]: https://vitejs.dev/\n[Vite Ruby]: https://github.com/ElMassimo/vite_ruby\n[SRI]: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity\n[manifest]: https://vitejs.dev/guide/backend-integration.html#backend-integration\n\n[rollup-plugin-sri]: https://github.com/JonasKruckenberg/rollup-plugin-sri\n[vite-plugin-sri]: https://github.com/small-tech/vite-plugin-sri\n[manifest]: https://vitejs.dev/guide/backend-integration.html\n[rendering]: https://vite-ruby.netlify.app/overview.html#in-production\n\n## Why? 🤔\n\n[Vite] does [not provide support](https://github.com/vitejs/vite/issues/2377) for [subresource integrity][sri].\n\nBoth <kbd>[vite-plugin-sri]</kbd> and <kbd>[rollup-plugin-sri]</kbd> are good\noptions to automatically add an [`integrity`][sri] hash to script and link tags. However, these rely on transforming an HTML file, which is typically not the case when using a backend integration such as [Vite Ruby].\n\nThis plugin extends [`manifest.json`][manifest] to include an [`integrity`][sri] field which can be used when [rendering] tags.\n\n## Installation 💿\n\nInstall the package as a development dependency:\n\n```bash\nnpm i -D vite-plugin-manifest-sri # pnpm i -D vite-plugin-manifest-sri\n```\n\n## Usage 🚀\n\nAdd it to your plugins in `vite.config.ts`:\n\n```ts\nimport { defineConfig } from 'vite'\nimport manifestSRI from 'vite-plugin-manifest-sri'\n\nexport default defineConfig({\n  plugins: [\n    manifestSRI(),\n  ],\n})\n```\n\nNote that the [`build.manifest`](https://vitejs.dev/config/#build-manifest) option\nmust be enabled in order to generate a `manifest.json` file ([Vite Ruby] enables it by default).\n\n### With [Vite Ruby] 💎\n\nExperimental support is [available](https://github.com/ElMassimo/vite_ruby/issues/176#issuecomment-1015920689), you can try it now by explicitly adding `4.0.0.alpha1` to your `Gemfile`:\n\n```ruby\ngem 'vite_rails', '~> 4.0.0.alpha1'\n```\n\n## Configuration ⚙️\n\nThe following options can be provided:\n\n- <kbd>algorithms</kbd>\n  \n  Hashing algorithms to use when calculate the integrity hash for each asset.\n\n  __Default:__ `['sha384']`\n\n  ``` js\n  manifestSRI({ algorithms: ['sha384', 'sha512'] }),\n  ``` \n\n## Acknowledgements\n\nThe following plugins might be useful for Vite apps based around an `index.html` file:\n\n- [`rollup-plugin-sri`](https://github.com/JonasKruckenberg/rollup-plugin-sri)\n- [`vite-plugin-sri`](https://github.com/small-tech/vite-plugin-sri)\n\n## License\n\nThis library is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","readmeFilename":"README.md"}