File tree Expand file tree Collapse file tree
packages/angular/build/src/utils/index-file Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,9 +163,10 @@ export async function augmentIndexHtml(
163163 if ( sri && chunksIntegrity ?. size ) {
164164 const integrity : Record < string , string > = { } ;
165165 // Stable iteration order for reproducible builds.
166- const sortedKeys = [ ...chunksIntegrity . keys ( ) ] . sort ( ) ;
167- for ( const url of sortedKeys ) {
168- integrity [ generateUrl ( url , deployUrl ) ] = chunksIntegrity . get ( url ) ! ;
166+ const sortedEntries = [ ...chunksIntegrity . entries ( ) ]
167+ . sort ( ( [ keyA ] , [ keyB ] ) => keyA . localeCompare ( keyB ) ) ;
168+ for ( const [ url , integrityHash ] of sortedEntries ) {
169+ integrity [ generateUrl ( url , deployUrl ) ] = integrityHash ;
169170 }
170171 headerLinkTags . push (
171172 `<script type="importmap">${ JSON . stringify ( { integrity } ) } </script>` ,
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ export interface IndexHtmlGeneratorOptions {
4949 imageDomains ?: string [ ] ;
5050 generateDedicatedSSRContent ?: boolean ;
5151 autoCsp ?: AutoCspOptions ;
52+
5253 /**
5354 * Integrity metadata for module URLs not directly referenced in the index
5455 * (typically lazy-loaded chunks). Forwarded to {@link augmentIndexHtml} so
You can’t perform that action at this time.
0 commit comments