aurelia / aurelia/cli

Automatic Subresource integrity attributes management for bundles

Open
#623 5 comments 0 reactions 0 assignees View on GitHub
bundler question
Dominant language
JavaScript
Stars
402
Forks
134
PR merge metrics
No merged PRs in 30d

Description

I'm planning to host my application static resources, bundles included, on a CDN so I started tackling the problem from the [Subresources Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) attributes creation and management.
The basic idea is to have a new option in the aurelia.json build object that, when enabled, will trigger the following actions during the building phase:

1. Compute the hash of the bundles (except the main one)
2. Update the requirejs configuration to emit the SRI attributes with the computed hash when requesting a bundle
3. Compute the main bundle hash
4. Update the index file with the SRI attributes for the main bundle

My current solution lives [here](https://github.com/ghidello/cli/tree/feat/subresource_integrity) for now but i was wondering if this kind of feature can be useful for anyone else before thinking to make a pull request.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.