File tree Expand file tree Collapse file tree 5 files changed +6
-4
lines changed
rspack_plugin_esm_library/src
tests/rspack-test/configCases/rslib Expand file tree Collapse file tree 5 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ impl EsmLibraryPlugin {
125125 ) ;
126126 }
127127 }
128+ break ; // Only process the first entry module with hashbang/directives
128129 }
129130
130131 let mut replace_auto_public_path = false ;
Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ async fn render(
156156 }
157157
158158 render_source. source = new_source. boxed ( ) ;
159+ break ;
159160 }
160161
161162 Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ impl JavascriptParserPlugin for ReactDirectivesParserPlugin {
5757
5858 for ( _, span) in directives {
5959 parser. add_presentational_dependency ( Box :: new ( ConstDependency :: new (
60- ( span. lo . 0 - 1 , span . hi . 0 - 1 ) . into ( ) ,
60+ span. into ( ) ,
6161 "" . into ( ) ,
6262 None ,
6363 ) ) ) ;
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const testCases = [
88] ;
99
1010testCases . forEach ( ( { name, file } ) => {
11- it ( `should include hashbang at the first line (${ name } )` , ( ) => {
11+ it ( `should include hashbang at the first line (${ name } )` , ( ) => {
1212 const filePath = path . resolve ( __dirname , file ) ;
1313 const content = fs . readFileSync ( filePath , 'utf-8' ) ;
1414
Original file line number Diff line number Diff line change @@ -8,14 +8,14 @@ const testCases = [
88] ;
99
1010testCases . forEach ( ( { name, file } ) => {
11- it ( `should include React directives with double quotes (${ name } )` , ( ) => {
11+ it ( `should include React directives with double quotes (${ name } )` , ( ) => {
1212 const filePath = path . resolve ( __dirname , file ) ;
1313 const content = fs . readFileSync ( filePath , 'utf-8' ) ;
1414
1515 expect ( content ) . toContain ( '"use client"' ) ;
1616 } ) ;
1717
18- it ( `should place directives before actual code (${ name } )` , ( ) => {
18+ it ( `should place directives before actual code (${ name } )` , ( ) => {
1919 const filePath = path . resolve ( __dirname , file ) ;
2020 const content = fs . readFileSync ( filePath , 'utf-8' ) ;
2121 const clientIndex = content . indexOf ( '"use client"' ) ;
You can’t perform that action at this time.
0 commit comments