@@ -254,107 +254,4 @@ describe('DevServerPlugin util', () => {
254
254
255
255
expect ( typeof entries === 'function' ) . toBe ( true ) ;
256
256
} ) ;
257
-
258
- ( isWebpack5 ? it : it . skip ) (
259
- 'should prepend devServer entry points depending on targetProperties' ,
260
- async ( ) => {
261
- // https://github.com/webpack/webpack/issues/11660
262
- const configNoChunkLoading = Object . assign ( { } , config ) ;
263
- configNoChunkLoading . output = Object . assign (
264
- {
265
- chunkLoading : false ,
266
- wasmLoading : false ,
267
- workerChunkLoading : false ,
268
- } ,
269
- config . output
270
- ) ;
271
-
272
- const webpackOptions = [
273
- Object . assign ( { target : [ 'web' , 'webworker' ] } , configNoChunkLoading ) ,
274
- Object . assign ( { target : 'browserslist:last 2 versions' } , config ) ,
275
- Object . assign ( { target : [ 'web' , 'node' ] } , configNoChunkLoading ) ,
276
- Object . assign (
277
- { target : 'browserslist:last 2 versions, maintained node versions' } ,
278
- configNoChunkLoading
279
- ) ,
280
- Object . assign (
281
- { target : 'browserslist:maintained node versions' } ,
282
- config
283
- ) ,
284
- Object . assign ( { target : false } , config ) ,
285
- ] ;
286
- const compiler = webpack ( webpackOptions ) ;
287
-
288
- const devServerOptions = {
289
- transportMode : {
290
- server : 'sockjs' ,
291
- client : 'sockjs' ,
292
- } ,
293
- } ;
294
-
295
- await Promise . all (
296
- // eslint-disable-next-line no-shadow
297
- compiler . compilers . map ( ( compiler , index ) => {
298
- const plugin = new DevServerPlugin ( devServerOptions ) ;
299
- plugin . apply ( compiler ) ;
300
-
301
- return getEntries ( compiler ) . then ( ( entries ) => {
302
- const expectInline = index < 2 ; /* all but the node target */
303
-
304
- expect ( entries . length ) . toEqual ( expectInline ? 2 : 1 ) ;
305
-
306
- if ( expectInline ) {
307
- expect (
308
- normalize ( entries [ 0 ] ) . indexOf ( 'client/default/index.js?' ) !== - 1
309
- ) . toBeTruthy ( ) ;
310
- }
311
-
312
- expect ( normalize ( entries [ expectInline ? 1 : 0 ] ) ) . toEqual (
313
- './foo.js'
314
- ) ;
315
- } ) ;
316
- } )
317
- ) ;
318
- }
319
- ) ;
320
-
321
- it ( 'should allows selecting compilations to inline the client into' , async ( ) => {
322
- const webpackOptions = [
323
- Object . assign ( { } , config ) ,
324
- Object . assign ( { target : 'web' } , config ) ,
325
- Object . assign ( { name : 'only-include' } , config ) /* index:2 */ ,
326
- Object . assign ( { target : 'node' } , config ) ,
327
- ] ;
328
- const compiler = webpack ( webpackOptions ) ;
329
-
330
- const devServerOptions = {
331
- injectClient : ( compilerConfig ) => compilerConfig . name === 'only-include' ,
332
- transportMode : {
333
- server : 'sockjs' ,
334
- client : 'sockjs' ,
335
- } ,
336
- } ;
337
-
338
- await Promise . all (
339
- // eslint-disable-next-line no-shadow
340
- compiler . compilers . map ( ( compiler , index ) => {
341
- const plugin = new DevServerPlugin ( devServerOptions ) ;
342
- plugin . apply ( compiler ) ;
343
- return getEntries ( compiler ) . then ( ( entries ) => {
344
- const expectInline =
345
- index === 2 ; /* only the "only-include" compiler */
346
-
347
- expect ( entries . length ) . toEqual ( expectInline ? 2 : 1 ) ;
348
-
349
- if ( expectInline ) {
350
- expect (
351
- normalize ( entries [ 0 ] ) . indexOf ( 'client/default/index.js?' ) !== - 1
352
- ) . toBeTruthy ( ) ;
353
- }
354
-
355
- expect ( normalize ( entries [ expectInline ? 1 : 0 ] ) ) . toEqual ( './foo.js' ) ;
356
- } ) ;
357
- } )
358
- ) ;
359
- } ) ;
360
257
} ) ;
0 commit comments