-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for integrity hashes #42
Conversation
@Lyrkan What do you think about not making this optional? What I mean is, we always look for the |
e023d90
to
7faf283
Compare
@weaverryan I removed the toggle and no I also made some changes in order to support the latest version of symfony/webpack-encore#522 (that allows to generate multiple hashes per file) and updated the demo link of my first post :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor stuff! Then it'll be ready for merge!
Awesome! Thank you @Lyrkan! |
@endelwar My bad for that one, wrong JSDoc type! I just pushed a fix in Encore, it'll be part of the next release (but you can safely ignore that warning for now). |
This PR allows to automatically add
integrity
attributes on<script>
and<link>
tags based on the content of theentrypoints.json
file (related to the following PR on Encore: symfony/webpack-encore#522).It requires the following configuration:
Then, calling
yarn encore
then generates an entrypoints.json that contains hashes for all the files it references:And these hashes are automatically added when calling
encore_entry_script_tags
andencore_entry_link_tags
:An example using Symfony Demo can be found here: Lyrkan/symfony-demo@91a06cd