Skip to content

Commit

Permalink
Server: preload section chunks (#98799)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr authored Jan 23, 2025
1 parent 2323c71 commit aa1ff39
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions client/document/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ class Document extends Component {
) ) }
{ chunkCssLinks( entrypoint, isRTL ) }
{ chunkCssLinks( chunkFiles, isRTL ) }
{ chunkFiles.js.map( ( chunk ) => (
<link key={ chunk } rel="preload" as="script" href={ chunk } />
) ) }
</Head>
<body
className={ clsx( {
Expand Down Expand Up @@ -243,10 +246,6 @@ class Document extends Component {
{ entrypoint.js.map( ( asset ) => (
<script key={ asset } src={ asset } />
) ) }

{ chunkFiles.js.map( ( chunk ) => (
<script key={ chunk } src={ chunk } />
) ) }
<script nonce={ inlineScriptNonce } type="text/javascript">
window.AppBoot();
</script>
Expand Down

0 comments on commit aa1ff39

Please sign in to comment.