@@ -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 } , [ ] )
@@ -648,7 +650,7 @@ const composeFormatConfig = ({
648650 } ,
649651 } ;
650652 case 'umd' : {
651- if ( bundle === false ) {
653+ if ( ! bundle ) {
652654 throw new Error (
653655 '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.' ,
654656 ) ;
@@ -686,7 +688,7 @@ const composeFormatConfig = ({
686688 return config ;
687689 }
688690 case 'iife' : {
689- if ( bundle === false ) {
691+ if ( ! bundle ) {
690692 throw new Error (
691693 '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.' ,
692694 ) ;
@@ -729,7 +731,7 @@ const composeFormatConfig = ({
729731 return config ;
730732 }
731733 case 'mf' :
732- if ( bundle === false ) {
734+ if ( ! bundle ) {
733735 throw new Error (
734736 '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.' ,
735737 ) ;
@@ -743,7 +745,7 @@ const composeFormatConfig = ({
743745 rspack : ( config , { env } ) => {
744746 config . output = {
745747 ...config . output ,
746- uniqueName : pkgJson . name as string ,
748+ uniqueName : pkgJson . name ,
747749 } ;
748750
749751 config . optimization = {
@@ -1086,7 +1088,7 @@ const composeEntryConfig = async (
10861088 } else {
10871089 // Non-existed file.
10881090 entryErrorReasons . push (
1089- `Can't resolve the entry ${ color . cyan ( `"${ entry } "` ) } at the location ${ color . cyan ( ` ${ entryAbsPath } ` ) } . Please ensure that the file exists.` ,
1091+ `Can't resolve the entry ${ color . cyan ( `"${ entry } "` ) } at the location ${ color . cyan ( entryAbsPath ) } . Please ensure that the file exists.` ,
10901092 ) ;
10911093 }
10921094 }
@@ -1253,12 +1255,13 @@ const composeBundlelessExternalConfig = (
12531255 async ( data , callback ) => {
12541256 const { request, getResolve, context, contextInfo } = data ;
12551257 if ( ! request || ! getResolve || ! context || ! contextInfo ) {
1256- return callback ( ) ;
1258+ callback ( ) ;
1259+ return ;
12571260 }
12581261 const { issuer } = contextInfo ;
12591262
12601263 if ( ! resolver ) {
1261- resolver = ( await getResolve ( ) ) as RspackResolver ;
1264+ resolver = getResolve ( ) as RspackResolver ;
12621265 }
12631266
12641267 async function redirectPath (
@@ -1327,7 +1330,8 @@ const composeBundlelessExternalConfig = (
13271330 }
13281331
13291332 if ( redirectedPath === undefined ) {
1330- return callback ( undefined , request ) ;
1333+ callback ( undefined , request ) ;
1334+ return ;
13311335 }
13321336
13331337 if ( jsRedirectPath ) {
@@ -1374,7 +1378,8 @@ const composeBundlelessExternalConfig = (
13741378 }
13751379 }
13761380
1377- return callback ( undefined , resolvedRequest ) ;
1381+ callback ( undefined , resolvedRequest ) ;
1382+ return ;
13781383 }
13791384
13801385 callback ( ) ;
0 commit comments