File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -391,45 +391,9 @@ class Server<
391391 return path . resolve ( dir , 'node_modules/.cache/rspack-dev-server' ) ;
392392 }
393393
394- static isWebTarget ( compiler : Compiler ) : boolean {
395- if ( compiler . platform ?. web ) {
396- return compiler . platform . web ;
397- }
398-
399- // TODO improve for the next major version and keep only `webTargets` to fallback for old versions
400- if ( compiler . options . externalsPresets ?. web ) {
401- return true ;
402- }
403-
404- if ( compiler . options . resolve ?. conditionNames ?. includes ( 'browser' ) ) {
405- return true ;
406- }
407-
408- const webTargets : ( string | undefined | null ) [ ] = [
409- 'web' ,
410- 'webworker' ,
411- 'electron-preload' ,
412- 'electron-renderer' ,
413- 'nwjs' ,
414- 'node-webkit' ,
415- undefined ,
416- null ,
417- ] ;
418-
419- if ( Array . isArray ( compiler . options . target ) ) {
420- return compiler . options . target . some ( ( r : string | undefined | null ) =>
421- webTargets . includes ( r ) ,
422- ) ;
423- }
424-
425- return webTargets . includes (
426- compiler . options . target as string | undefined | null ,
427- ) ;
428- }
429-
430394 addAdditionalEntries ( compiler : Compiler ) {
431395 const additionalEntries : string [ ] = [ ] ;
432- const isWebTarget = Server . isWebTarget ( compiler ) ;
396+ const isWebTarget = Boolean ( compiler . platform . web ) ;
433397
434398 // TODO maybe empty client
435399 if ( this . options . client && isWebTarget ) {
You can’t perform that action at this time.
0 commit comments