@@ -218,7 +218,8 @@ const composeExternalsWarnConfig = (
218218 asyncFlag = false ;
219219 return ;
220220 }
221- return next ( ) ;
221+ next ( ) ;
222+ return ;
222223 }
223224
224225 callback ( matched , shouldWarn ) ;
@@ -227,7 +228,8 @@ const composeExternalsWarnConfig = (
227228 do {
228229 asyncFlag = true ;
229230 if ( i >= externals . length ) {
230- return callback ( false ) ;
231+ callback ( false ) ;
232+ return ;
231233 }
232234 matchUserExternals (
233235 externals [ i ++ ] ,
@@ -308,7 +310,7 @@ export const composeAutoExternalConfig = (options: {
308310 const { bundle, format, pkgJson, userExternals } = options ;
309311
310312 // If bundle is false, autoExternal will be disabled
311- if ( bundle === false ) {
313+ if ( ! bundle ) {
312314 return { } ;
313315 }
314316
@@ -352,7 +354,7 @@ export const composeAutoExternalConfig = (options: {
352354 )
353355 . reduce < string [ ] > ( ( prev , type ) => {
354356 if ( externalOptions [ type ] ) {
355- return pkgJson [ type ] ? prev . concat ( Object . keys ( pkgJson [ type ] ! ) ) : prev ;
357+ return pkgJson [ type ] ? prev . concat ( Object . keys ( pkgJson [ type ] ) ) : prev ;
356358 }
357359 return prev ;
358360 } , [ ] )
@@ -654,7 +656,7 @@ const composeFormatConfig = ({
654656 } ,
655657 } ;
656658 case 'umd' : {
657- if ( bundle === false ) {
659+ if ( ! bundle ) {
658660 throw new Error (
659661 'When using "umd" format, "bundle" must be set to "true". Since the default value for "bundle" is "true", so you can either explicitly set it to "true" or remove the field entirely.' ,
660662 ) ;
@@ -692,7 +694,7 @@ const composeFormatConfig = ({
692694 return config ;
693695 }
694696 case 'iife' : {
695- if ( bundle === false ) {
697+ if ( ! bundle ) {
696698 throw new Error (
697699 'When using "iife" format, "bundle" must be set to "true". Since the default value for "bundle" is "true", so you can either explicitly set it to "true" or remove the field entirely.' ,
698700 ) ;
@@ -735,7 +737,7 @@ const composeFormatConfig = ({
735737 return config ;
736738 }
737739 case 'mf' :
738- if ( bundle === false ) {
740+ if ( ! bundle ) {
739741 throw new Error (
740742 'When using "mf" format, "bundle" must be set to "true". Since the default value for "bundle" is "true", so you can either explicitly set it to "true" or remove the field entirely.' ,
741743 ) ;
@@ -749,7 +751,7 @@ const composeFormatConfig = ({
749751 rspack : ( config , { env } ) => {
750752 config . output = {
751753 ...config . output ,
752- uniqueName : pkgJson . name as string ,
754+ uniqueName : pkgJson . name ,
753755 } ;
754756
755757 config . optimization = {
@@ -1092,7 +1094,7 @@ const composeEntryConfig = async (
10921094 } else {
10931095 // Non-existed file.
10941096 entryErrorReasons . push (
1095- `Can't resolve the entry ${ color . cyan ( `"${ entry } "` ) } at the location ${ color . cyan ( ` ${ entryAbsPath } ` ) } . Please ensure that the file exists.` ,
1097+ `Can't resolve the entry ${ color . cyan ( `"${ entry } "` ) } at the location ${ color . cyan ( entryAbsPath ) } . Please ensure that the file exists.` ,
10961098 ) ;
10971099 }
10981100 }
@@ -1259,12 +1261,13 @@ const composeBundlelessExternalConfig = (
12591261 async ( data , callback ) => {
12601262 const { request, getResolve, context, contextInfo } = data ;
12611263 if ( ! request || ! getResolve || ! context || ! contextInfo ) {
1262- return callback ( ) ;
1264+ callback ( ) ;
1265+ return ;
12631266 }
12641267 const { issuer } = contextInfo ;
12651268
12661269 if ( ! resolver ) {
1267- resolver = ( await getResolve ( ) ) as RspackResolver ;
1270+ resolver = getResolve ( ) as RspackResolver ;
12681271 }
12691272
12701273 async function redirectPath (
@@ -1333,7 +1336,8 @@ const composeBundlelessExternalConfig = (
13331336 }
13341337
13351338 if ( redirectedPath === undefined ) {
1336- return callback ( undefined , request ) ;
1339+ callback ( undefined , request ) ;
1340+ return ;
13371341 }
13381342
13391343 if ( jsRedirectPath ) {
@@ -1380,7 +1384,8 @@ const composeBundlelessExternalConfig = (
13801384 }
13811385 }
13821386
1383- return callback ( undefined , resolvedRequest ) ;
1387+ callback ( undefined , resolvedRequest ) ;
1388+ return ;
13841389 }
13851390
13861391 callback ( ) ;
0 commit comments