Skip to content

jonathannen/parcel-plugin-subresource-integrity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parcel-plugin-subresource-integrity

Adds Subresource Integrity attributes to any CSS and JS bundled files referenced from your Parcel Bundler 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.

About

Generates Subresource Integrity attributes for Parcel outputs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published