humanmade / humanmade/webpack-helpers

Include webpack-subresource-integrity plugin

Open
#37 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
29
Forks
2
PR merge metrics
No merged PRs in 30d

Description

https://www.npmjs.com/package/webpack-subresource-integrity

This plugin has two effects, one for HtmlWebpackPlugin which doesn't affect but also provides support for chunks created when we're using code splitting. It adds `integrity` and `crossorigin` attributes to dynamically loaded scripts with the hash of the loaded file.

It's an added security feature and will be important to use in conjunction with any future sites that want to use the `require-sri` content security policy.

Notes:

- You have to set the `output.crossOriginLoading` parameter, use "anonymous" as the value
- Only need to use a single hash function eg. `hashFuncNames: [ 'sha384' ]` is a good default

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.