Gatsby plugin for enabling Subresource Integrity (SRI)
npm install gatsby-plugin-sri





A Gatsby plugin to add Subresource Integrity (SRI) to your generated script tags.
``html``
becomeshtml`
With npm:
`bash`
npm install --save gatsby-plugin-sri
Or with Yarn:
`bash`
yarn add gatsby-plugin-sri
In your gatsby-config.js file add:
`javascript`
module.exports = {
plugins: [
{
resolve: 'gatsby-plugin-sri',
options: {
hash: 'sha512', // 'sha256', 'sha384' or 'sha512' ('sha512' = default)
crossorigin: false // Optional
}
}
]
}
The crossorigin option, if set to true, will optionally add add a crossorigin="anonymous" attribute to the script / style tags.
Osmond van Hemert


If you would like to help out with some code, check the details.
Not a coder, but still want to support? Have a look at the options available to donate.

Licensed under MIT.
_NOTE: This plugin only generates output when run in production mode! To test your generated tags, run: gatsby build && gatsby serve`_