Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonathannen/parcel-plugin-subresource-integrity
Generates Subresource Integrity attributes for Parcel outputs
https://github.com/jonathannen/parcel-plugin-subresource-integrity
Last synced: 2 months ago
JSON representation
Generates Subresource Integrity attributes for Parcel outputs
- Host: GitHub
- URL: https://github.com/jonathannen/parcel-plugin-subresource-integrity
- Owner: jonathannen
- License: mit
- Created: 2019-07-02T05:17:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-04T05:39:16.000Z (almost 5 years ago)
- Last Synced: 2024-05-21T02:58:23.382Z (8 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-parcel - parcel-plugin-subresource-integrity
README
# parcel-plugin-subresource-integrity
Adds [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) attributes to any CSS and JS bundled files referenced from your [Parcel Bundler](https://parceljs.org/) entry HTML asset (index.html).
## Usage
No configuration is needed. Install the package using yarn or npm and build using Parcel.
The integrity attribute will be added to any asset referenced from a HTML parcel entry point. Specifically, the plugin scans the output HTML (typically your index.html) and inserts the integrity attribute on any link or script tags that reference local assets.
If you're using the publicURL option, the crossorigin="anonymous" attribute is also added.
Integrity attributes are only added in production (i.e. when running parcel build) as it tends to get out of sync easily in watch mode. By default, the SHA-384 hash algorithm will be used.