Angular v9 subresource-integrity flag not adding integrity

Discussão em 'Angular' iniciado por murrag, Março 19, 2025.

  1. murrag

    murrag Guest

    I am working on an Angular 9 application and attempting to use the subresource integrity flag when building with ng build but I am not seeing any integrity properties added in the generated index.html page. Unfortunately I cannot add any of the code as it is a work project

    We are specifically using Angular v9.1.13 and angular CLI v9.1.15. I have tried building with

    ng build --subresource-integrity

    ng build --subresource-integrity true

    ng build --subresource-integrity=true

    ng build --subresource-integrity --prod

    ng build --subresource-integrity --configuration=dev

    and every time when I check the generated index file the only integrity attributes I am seeing are the ones previously added manually. Even when deleting some of the manually added ones and rebuilding I am not seeing them being added either. I have also added subresourceIntegrity: true into all of the build configurations in the angular.json file but this also does not seem to have any effect, and I updated the package.json build script to include --subresource-integrity and had no luck with it either

    From my understanding subresource-integrity has been in Angular CLI since v1.something so v9 should be just fine, and Angular v9 should also be recent enough to handle it, so I can not seem to figure out why I am not seeing integrity tags. I have deleted the dist folder and rebuilt at least a dozen times today but to no avail.

    I have already looked at and attempted the answers from the below questions and neither are working.

    Subresource Integrity With Angular-Cli How to add subresources integrity with Angular appShell build

    Continue reading...

Compartilhe esta Página