Title: Allow index.preloadInitial to preload the full static closure of the initial bundle (number or "all") · Issue #34396 · angular/angular-cli · GitHub
Open Graph Title: Allow index.preloadInitial to preload the full static closure of the initial bundle (number or "all") · Issue #34396 · angular/angular-cli
X Title: Allow index.preloadInitial to preload the full static closure of the initial bundle (number or "all") · Issue #34396 · angular/angular-cli
Description: Command build Description #27581 limited modulepreload hints to a shallow set of 10 initial chunks, as a safe default for all applications (#27490). For an application with a deep initial import graph that default costs one network round...
Open Graph Description: Command build Description #27581 limited modulepreload hints to a shallow set of 10 initial chunks, as a safe default for all applications (#27490). For an application with a deep initial import gr...
X Description: Command build Description #27581 limited modulepreload hints to a shallow set of 10 initial chunks, as a safe default for all applications (#27490). For an application with a deep initial import gr...
Opengraph URL: https://github.com/angular/angular-cli/issues/34396
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow index.preloadInitial to preload the full static closure of the initial bundle (number or \"all\")","articleBody":"### Command\n\nbuild\n\n### Description\n\n#27581 limited modulepreload hints to a shallow set of 10 initial chunks, as a safe default for all applications (#27490). For an application with a deep initial import graph that default costs one network round trip per depth level: the browser only discovers the chunks at depth N after the chunks at depth N-1 have arrived and been parsed.\n\nOur `main` has a static closure of 45 chunks across six depth levels. We post-process `index.html` after `ng build` to preload all of them. Measured in production RUM over three weeks (roughly a million initial loads per week), weekdays before versus after:\n\n| Segment | LCP p75 before | LCP p75 after |\n| --- | --- | --- |\n| all initial loads | 2.00 s | 1.84 s |\n| effective connection type 4g, desktop | 2.07 s | 1.91 s |\n| effective connection type 3g, desktop | 7.0 s | 5.3 s |\n| effective connection type 2g, desktop | 22.8 s | 14.7 s |\n\nThe slowest connections gained the most, which is the opposite of what the HTTP Archive correlation cited in #27490 would predict. That correlation covers preloads of any resource. Chunks in the entry point's static closure are all required before the application can execute at all, so preloading them does not compete with anything more critical than the stylesheet.\n\n### Describe the solution you'd like\n\nLet `index.preloadInitial` accept a number or `\"all\"` in addition to the current boolean, keeping `true` as today's shallow-10 behaviour. That would let us delete a post-build script that has to track the CLI's `index.html` output, and which broke on the `integrity` attributes added in 22.x.\n\n### Describe alternatives you've considered\n\nPost-processing `index.html` (what we do now); setting `preloadInitial: false` and writing every hint ourselves (same fragility); eager-loading the landing route into the main bundle (adds 330 KB gzipped to every first load for the 70% of visits that land elsewhere).\n","author":{"url":"https://github.com/bgpedersen","@type":"Person","name":"bgpedersen"},"datePublished":"2026-10-19T08:22:02Z","url":"https://github.com/angular/angular-cli/issues/34396"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a81be297-7525-0d64-c1b8-eee0ee5b0591 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E5E2:2E9831:1071264:15C2743:6B01DE44 |
| html-safe-nonce | dff31683d0ca5156844bcfa470d1b57e66928145190fdafded65194a9d2b69f4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUUyOjJFOTgzMToxMDcxMjY0OjE1QzI3NDM6NkIwMURFNDQiLCJ2aXNpdG9yX2lkIjoiMjEwNDM5MTkxMjIwMjAzNDc1NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4fa6332d3d48452dae64f85d7dadfa6caec7a5b24637da6a6d0e1f8049ec1ef4 |
| hovercard-subject-tag | issue:5920389615 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/34396/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ed11dbc7ae5333e4ecd1594f52c4af67f0723741c6b82cd64110da51b543890e/angular/angular-cli/issues/34396 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ed11dbc7ae5333e4ecd1594f52c4af67f0723741c6b82cd64110da51b543890e/angular/angular-cli/issues/34396 |
| og:image:alt | Command build Description #27581 limited modulepreload hints to a shallow set of 10 initial chunks, as a safe default for all applications (#27490). For an application with a deep initial import gr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bgpedersen |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width