I was wondering if anyone knew of a possible way to activate Subresource Integrety with Angular-Cli. According to the following link: GitHub Pull Request It would be a feature (or a future feature). I was hoping to activate it but it does not seem to be active on the current versions. Is there another way to use Subresource Integrety with Angular-Cli?
Subresource Integrity With Angular-Cli
Pass the --subresource-integrity
flag into your ng build command.
You can verify that it works by looking at your index.html file. You'll see the integrity attribute on linked stylesheets and scripts.
SRI requires v1.5.0+ of the CLI.
E.G. ng build --subresource-integrity
Unfortunately I won't be able to test this soon so if anyone has success with this solution please let me know so I can mark this as the answer :). –
Exceptive
--subresource-integrity
flag is only available for the build command, not serve –
Melanymelaphyre I feel like it used to work on a serve command. Maybe it did when I wrote the answer. But when I try it now the CLI puts a note in the console that it ignores that SRI flag. I'll update the answer accordingly. –
Neoptolemus
That is true for just about everything in the modern web. If possible, I recommending encouraging your customers, users, and/or management to stop using or supporting IE. (Good luck.) –
Neoptolemus
Now we can simply add "subresourceIntegrity": true
in production
configurations
in angular.json
file
© 2022 - 2024 — McMap. All rights reserved.