File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed
crates/rspack_plugin_next_flight_client_entry/src Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ mod is_metadata_route;
55mod loader_util;
66
77use std:: {
8+ cmp:: Ordering ,
89 mem,
910 ops:: DerefMut ,
1011 path:: Path ,
@@ -642,10 +643,12 @@ impl FlightClientEntryPlugin {
642643 . collect ( ) ;
643644
644645 modules. sort_unstable_by ( |a, b| {
645- if REGEX_CSS . is_match ( & b. 0 ) {
646- std:: cmp:: Ordering :: Greater
647- } else {
648- a. 0 . cmp ( & b. 0 )
646+ let a_is_css = REGEX_CSS . is_match ( & a. 0 ) ;
647+ let b_is_css = REGEX_CSS . is_match ( & b. 0 ) ;
648+ match ( ( a_is_css, b_is_css) ) {
649+ ( false , true ) => Ordering :: Less ,
650+ ( true , false ) => Ordering :: Greater ,
651+ ( _, _) => a. 0 . cmp ( & b. 0 ) ,
649652 }
650653 } ) ;
651654
Original file line number Diff line number Diff line change 1+ module . exports = {
2+ context : __dirname ,
3+ entry : {
4+ main : './src/index.js'
5+ } ,
6+ plugins : [ {
7+ apply ( compiler ) {
8+ compiler . hooks . emit . tap ( { name : 'MyPlugin' , stage : 0 } , compilation => {
9+ console . log ( 'This is an example plugin!' ) ;
10+ } )
11+
12+ }
13+ } ]
14+ }
You can’t perform that action at this time.
0 commit comments