@@ -16,7 +16,7 @@ use crate::{
1616 InputOptions , Output , OutputFormat ,
1717} ;
1818use index_vec:: { index_vec, IndexVec } ;
19- use rolldown_common:: { ExportsKind , ImportKind , ModuleId , NamedImport , SymbolRef } ;
19+ use rolldown_common:: { EntryPointKind , ExportsKind , ImportKind , ModuleId , NamedImport , SymbolRef } ;
2020use rustc_hash:: { FxHashMap , FxHashSet } ;
2121
2222pub struct BundleStage < ' a > {
@@ -63,10 +63,10 @@ impl<'a> BundleStage<'a> {
6363 Output :: Chunk ( Box :: new ( OutputChunk {
6464 file_name : c. file_name . clone ( ) . unwrap ( ) ,
6565 code : content,
66- is_entry : c . entry_module . is_some ( ) ,
67- facade_module_id : c
68- . entry_module
69- . map ( |id| self . link_output . modules [ id ] . expect_normal ( ) . pretty_path . to_string ( ) ) ,
66+ is_entry : matches ! ( & c . entry_point , Some ( e ) if e . kind == EntryPointKind :: UserSpecified ) ,
67+ facade_module_id : c. entry_point . as_ref ( ) . map ( |entry_point| {
68+ self . link_output . modules [ entry_point . module_id ] . expect_normal ( ) . pretty_path . to_string ( )
69+ } ) ,
7070 modules : rendered_modules,
7171 exports : c. get_export_names ( self . link_output , self . output_options ) ,
7272 } ) )
@@ -163,8 +163,8 @@ impl<'a> BundleStage<'a> {
163163 }
164164 }
165165
166- if let Some ( entry_module ) = chunk. entry_module {
167- let entry_module = & self . link_output . modules [ entry_module ] ;
166+ if let Some ( entry_point ) = & chunk. entry_point {
167+ let entry_module = & self . link_output . modules [ entry_point . module_id ] ;
168168 let Module :: Normal ( entry_module) = entry_module else {
169169 return ;
170170 } ;
@@ -203,7 +203,7 @@ impl<'a> BundleStage<'a> {
203203 }
204204 }
205205
206- if chunk. entry_module . is_none ( ) {
206+ if chunk. entry_point . is_none ( ) {
207207 continue ;
208208 }
209209 // If this is an entry point, make sure we import all chunks belonging to
@@ -273,7 +273,7 @@ impl<'a> BundleStage<'a> {
273273 bits. set_bit ( count) ;
274274 let chunk = chunks. push ( Chunk :: new (
275275 entry_point. name . clone ( ) ,
276- Some ( entry_point. module_id ) ,
276+ Some ( entry_point. clone ( ) ) ,
277277 bits. clone ( ) ,
278278 vec ! [ ] ,
279279 ) ) ;
0 commit comments