@@ -1555,92 +1555,92 @@ Or do you want to use the entrypoints '{name}' and '{runtime}' independently on
15551555 let loc = block. loc ( ) ;
15561556
15571557 let cgi = if let Some ( entry_options) = entry_options {
1558- let cgi =
1559- if let Some ( cgi) = chunk_name. and_then ( |name| self . named_async_entrypoints . get ( name. as_ref ( ) ) ) {
1560- let cgi = self . chunk_group_infos . expect_get ( cgi) ;
1558+ let cgi = if let Some ( cgi) =
1559+ chunk_name. and_then ( |name| self . named_async_entrypoints . get ( name. as_ref ( ) ) )
1560+ {
1561+ let cgi = self . chunk_group_infos . expect_get ( cgi) ;
15611562
1562- compilation
1563- . build_chunk_graph_artifact
1564- . chunk_group_by_ukey
1565- . expect_get_mut ( & cgi. chunk_group )
1566- . add_origin ( Some ( module_id) , loc, request) ;
1563+ compilation
1564+ . build_chunk_graph_artifact
1565+ . chunk_group_by_ukey
1566+ . expect_get_mut ( & cgi. chunk_group )
1567+ . add_origin ( Some ( module_id) , loc, request) ;
15671568
1568- compilation
1569- . build_chunk_graph_artifact
1570- . chunk_graph
1571- . connect_block_and_chunk_group ( block_id, cgi. chunk_group ) ;
1572- cgi. ukey
1573- } else {
1574- let entry_options = entry_options. clone ( ) ;
1575- let chunk = compilation
1576- . build_chunk_graph_artifact
1577- . chunk_by_ukey
1578- . expect_get_mut ( & chunk_ukey) ;
1579- if let Some ( filename) = & entry_options. filename {
1580- chunk. set_filename_template ( Some ( filename. clone ( ) ) ) ;
1581- }
1582- let mut entrypoint = ChunkGroup :: new ( ChunkGroupKind :: new_entrypoint (
1583- false ,
1584- Box :: new ( entry_options. clone ( ) ) ,
1585- ) ) ;
1586-
1587- self . stat_chunk_group_created += 1 ;
1588- let cgi = ChunkGroupInfo :: new (
1589- entrypoint. ukey ,
1590- Arc :: new (
1591- RuntimeSpec :: from_entry_options ( & entry_options)
1592- . expect ( "should have runtime for AsyncEntrypoint" ) ,
1593- ) ,
1594- entry_options
1595- . chunk_loading
1596- . as_ref ( )
1597- . map_or ( item_chunk_group_info. chunk_loading , |x| {
1598- !matches ! ( x, ChunkLoading :: Disable )
1599- } ) ,
1600- entry_options
1601- . async_chunks
1602- . unwrap_or ( item_chunk_group_info. async_chunks ) ,
1603- ) ;
1604- let ukey = cgi. ukey ;
1569+ compilation
1570+ . build_chunk_graph_artifact
1571+ . chunk_graph
1572+ . connect_block_and_chunk_group ( block_id, cgi. chunk_group ) ;
1573+ cgi. ukey
1574+ } else {
1575+ let entry_options = entry_options. clone ( ) ;
1576+ let chunk = compilation
1577+ . build_chunk_graph_artifact
1578+ . chunk_by_ukey
1579+ . expect_get_mut ( & chunk_ukey) ;
1580+ if let Some ( filename) = & entry_options. filename {
1581+ chunk. set_filename_template ( Some ( filename. clone ( ) ) ) ;
1582+ }
1583+ let mut entrypoint = ChunkGroup :: new ( ChunkGroupKind :: new_entrypoint (
1584+ false ,
1585+ Box :: new ( entry_options. clone ( ) ) ,
1586+ ) ) ;
16051587
1606- self . chunk_group_infos . entry ( ukey) . or_insert ( cgi) ;
1588+ self . stat_chunk_group_created += 1 ;
1589+ let cgi = ChunkGroupInfo :: new (
1590+ entrypoint. ukey ,
1591+ Arc :: new (
1592+ RuntimeSpec :: from_entry_options ( & entry_options)
1593+ . expect ( "should have runtime for AsyncEntrypoint" ) ,
1594+ ) ,
1595+ entry_options
1596+ . chunk_loading
1597+ . as_ref ( )
1598+ . map_or ( item_chunk_group_info. chunk_loading , |x| {
1599+ !matches ! ( x, ChunkLoading :: Disable )
1600+ } ) ,
1601+ entry_options
1602+ . async_chunks
1603+ . unwrap_or ( item_chunk_group_info. async_chunks ) ,
1604+ ) ;
1605+ let ukey = cgi. ukey ;
16071606
1608- entrypoint. set_runtime_chunk ( chunk. ukey ( ) ) ;
1609- entrypoint. set_entrypoint_chunk ( chunk. ukey ( ) ) ;
1610- compilation
1611- . build_chunk_graph_artifact
1612- . async_entrypoints
1613- . push ( entrypoint. ukey ) ;
1614- self . next_chunk_group_index += 1 ;
1615- entrypoint. index = Some ( self . next_chunk_group_index ) ;
1616-
1617- if let Some ( name) = entrypoint. kind . name ( ) {
1618- let name_key: Arc < str > = Arc :: from ( name) ;
1619- self . named_async_entrypoints . insert ( name_key. clone ( ) , ukey) ;
1620- compilation
1621- . build_chunk_graph_artifact
1622- . named_chunk_groups
1623- . insert ( name_key. clone ( ) , entrypoint. ukey ) ;
1624- compilation
1625- . build_chunk_graph_artifact
1626- . named_chunks
1627- . insert ( name_key, chunk. ukey ( ) ) ;
1628- }
1607+ self . chunk_group_infos . entry ( ukey) . or_insert ( cgi) ;
16291608
1630- entrypoint. connect_chunk ( chunk) ;
1609+ entrypoint. set_runtime_chunk ( chunk. ukey ( ) ) ;
1610+ entrypoint. set_entrypoint_chunk ( chunk. ukey ( ) ) ;
1611+ compilation
1612+ . build_chunk_graph_artifact
1613+ . async_entrypoints
1614+ . push ( entrypoint. ukey ) ;
1615+ self . next_chunk_group_index += 1 ;
1616+ entrypoint. index = Some ( self . next_chunk_group_index ) ;
16311617
1632- self . chunk_group_info_map . insert ( entrypoint. ukey , ukey) ;
1618+ if let Some ( name) = entrypoint. kind . name ( ) {
1619+ self . named_async_entrypoints . insert ( name. clone ( ) , ukey) ;
16331620 compilation
16341621 . build_chunk_graph_artifact
1635- . chunk_graph
1636- . connect_block_and_chunk_group ( block_id, entrypoint. ukey ) ;
1637-
1622+ . named_chunk_groups
1623+ . insert ( name. clone ( ) , entrypoint. ukey ) ;
16381624 compilation
16391625 . build_chunk_graph_artifact
1640- . chunk_group_by_ukey
1641- . add ( entrypoint) ;
1642- ukey
1643- } ;
1626+ . named_chunks
1627+ . insert ( name. clone ( ) , chunk. ukey ( ) ) ;
1628+ }
1629+
1630+ entrypoint. connect_chunk ( chunk) ;
1631+
1632+ self . chunk_group_info_map . insert ( entrypoint. ukey , ukey) ;
1633+ compilation
1634+ . build_chunk_graph_artifact
1635+ . chunk_graph
1636+ . connect_block_and_chunk_group ( block_id, entrypoint. ukey ) ;
1637+
1638+ compilation
1639+ . build_chunk_graph_artifact
1640+ . chunk_group_by_ukey
1641+ . add ( entrypoint) ;
1642+ ukey
1643+ } ;
16441644
16451645 let cgi = self . chunk_group_infos . expect_get ( & cgi) ;
16461646 entrypoint = Some ( cgi. chunk_group ) ;
@@ -1714,11 +1714,11 @@ Or do you want to use the entrypoints '{name}' and '{runtime}' independently on
17141714 chunk_group. index = Some ( self . next_chunk_group_index ) ;
17151715
17161716 if let Some ( name) = chunk_group. kind . name ( ) {
1717- self . named_chunk_groups . insert ( Arc :: from ( name) , info_ukey) ;
1717+ self . named_chunk_groups . insert ( name. clone ( ) , info_ukey) ;
17181718 compilation
17191719 . build_chunk_graph_artifact
17201720 . named_chunk_groups
1721- . insert ( Arc :: from ( name) , chunk_group. ukey ) ;
1721+ . insert ( name. clone ( ) , chunk_group. ukey ) ;
17221722 }
17231723
17241724 chunk_group. connect_chunk ( chunk) ;
0 commit comments