@@ -62,8 +62,8 @@ describe('Functional tests using webpack', function() {
62
62
'main.js' ,
63
63
'font.css' ,
64
64
'bg.css' ,
65
- 'fonts/Roboto.woff2' ,
66
- 'images/symfony_logo.png' ,
65
+ 'fonts/Roboto.9896f773. woff2' ,
66
+ 'images/symfony_logo.ea1ca6f7. png' ,
67
67
'manifest.json'
68
68
] ) ;
69
69
@@ -87,11 +87,11 @@ describe('Functional tests using webpack', function() {
87
87
) ;
88
88
webpackAssert . assertManifestPath (
89
89
'build/fonts/Roboto.woff2' ,
90
- '/build/fonts/Roboto.woff2'
90
+ '/build/fonts/Roboto.9896f773. woff2'
91
91
) ;
92
92
webpackAssert . assertManifestPath (
93
93
'build/images/symfony_logo.png' ,
94
- '/build/images/symfony_logo.png'
94
+ '/build/images/symfony_logo.ea1ca6f7. png'
95
95
) ;
96
96
97
97
done ( ) ;
@@ -119,11 +119,11 @@ describe('Functional tests using webpack', function() {
119
119
120
120
webpackAssert . assertOutputFileContains (
121
121
'bg.css' ,
122
- 'http://localhost:8090/assets/images/symfony_logo.png'
122
+ 'http://localhost:8090/assets/images/symfony_logo.ea1ca6f7. png'
123
123
) ;
124
124
webpackAssert . assertOutputFileContains (
125
125
'font.css' ,
126
- 'http://localhost:8090/assets/fonts/Roboto.woff2'
126
+ 'http://localhost:8090/assets/fonts/Roboto.9896f773. woff2'
127
127
) ;
128
128
// manifest file has CDN in value
129
129
webpackAssert . assertManifestPath (
@@ -172,7 +172,7 @@ describe('Functional tests using webpack', function() {
172
172
173
173
webpackAssert . assertOutputFileContains (
174
174
'bg.css' ,
175
- 'http://localhost:8090/assets/images/symfony_logo.png'
175
+ 'http://localhost:8090/assets/images/symfony_logo.ea1ca6f7. png'
176
176
) ;
177
177
// manifest file has CDN in value
178
178
webpackAssert . assertManifestPath (
@@ -285,20 +285,20 @@ describe('Functional tests using webpack', function() {
285
285
'0.d002be21e9bcf76057e9.js' , // chunks are also versioned
286
286
'main.292c0347ed1240663cb1.js' ,
287
287
'h1.c84caea6dd12bba7955dee9fedd5fd03.css' ,
288
- 'bg.42ced8eae2254268bb3c65f1e65bd041 .css' ,
288
+ 'bg.483832e48e67e6a3b7f0ae064eadca51 .css' ,
289
289
'manifest.json'
290
290
]
291
291
) ;
292
292
293
293
expect ( path . join ( config . outputPath , 'images' ) ) . to . be . a . directory ( )
294
294
. with . files ( [
295
- 'symfony_logo.ea1ca6f7f3719118f301a5cfcb1df3c0 .png'
295
+ 'symfony_logo.ea1ca6f7 .png'
296
296
]
297
297
) ;
298
298
299
299
webpackAssert . assertOutputFileContains (
300
- 'bg.42ced8eae2254268bb3c65f1e65bd041 .css' ,
301
- '/build/images/symfony_logo.ea1ca6f7f3719118f301a5cfcb1df3c0 .png'
300
+ 'bg.483832e48e67e6a3b7f0ae064eadca51 .css' ,
301
+ '/build/images/symfony_logo.ea1ca6f7 .png'
302
302
) ;
303
303
304
304
done ( ) ;
@@ -323,28 +323,76 @@ describe('Functional tests using webpack', function() {
323
323
324
324
expect ( path . join ( config . outputPath , 'images' ) ) . to . be . a . directory ( )
325
325
. with . files ( [
326
- 'symfony_logo.png'
326
+ 'symfony_logo.ea1ca6f7. png'
327
327
]
328
328
) ;
329
329
330
330
expect ( path . join ( config . outputPath , 'fonts' ) ) . to . be . a . directory ( )
331
331
. with . files ( [
332
- 'Roboto.woff2'
332
+ 'Roboto.9896f773. woff2'
333
333
]
334
334
) ;
335
335
336
336
webpackAssert . assertOutputFileContains (
337
337
'bg.css' ,
338
- '/build/images/symfony_logo.png'
338
+ '/build/images/symfony_logo.ea1ca6f7. png'
339
339
) ;
340
+
340
341
webpackAssert . assertOutputFileContains (
341
342
'font.css' ,
342
- '/build/fonts/Roboto.woff2'
343
+ '/build/fonts/Roboto.9896f773.woff2'
344
+ ) ;
345
+
346
+ done ( ) ;
347
+ } ) ;
348
+ } ) ;
349
+
350
+ it ( 'two fonts or images with the same filename should not output a single file' , ( done ) => {
351
+ const config = createWebpackConfig ( 'www/build' , 'dev' ) ;
352
+ config . setPublicPath ( '/build' ) ;
353
+ config . addStyleEntry ( 'styles' , './css/same_filename.css' ) ;
354
+ config . enableSassLoader ( ) ;
355
+
356
+ testSetup . runWebpack ( config , ( webpackAssert ) => {
357
+ expect ( config . outputPath ) . to . be . a . directory ( )
358
+ . with . files ( [
359
+ 'styles.css' ,
360
+ 'manifest.json'
361
+ ]
362
+ ) ;
363
+
364
+ expect ( path . join ( config . outputPath , 'images' ) ) . to . be . a . directory ( )
365
+ . with . files ( [
366
+ 'symfony_logo.ea1ca6f7.png' ,
367
+ 'symfony_logo.f27119c2.png'
368
+ ]
369
+ ) ;
370
+
371
+ expect ( path . join ( config . outputPath , 'fonts' ) ) . to . be . a . directory ( )
372
+ . with . files ( [
373
+ 'Roboto.9896f773.woff2' ,
374
+ 'Roboto.3c37aa69.woff2'
375
+ ]
343
376
) ;
344
377
345
378
webpackAssert . assertOutputFileContains (
346
- 'font.css' ,
347
- '/build/fonts/Roboto.woff2'
379
+ 'styles.css' ,
380
+ '/build/images/symfony_logo.ea1ca6f7.png'
381
+ ) ;
382
+
383
+ webpackAssert . assertOutputFileContains (
384
+ 'styles.css' ,
385
+ '/build/images/symfony_logo.f27119c2.png'
386
+ ) ;
387
+
388
+ webpackAssert . assertOutputFileContains (
389
+ 'styles.css' ,
390
+ '/build/fonts/Roboto.9896f773.woff2'
391
+ ) ;
392
+
393
+ webpackAssert . assertOutputFileContains (
394
+ 'styles.css' ,
395
+ '/build/fonts/Roboto.3c37aa69.woff2'
348
396
) ;
349
397
350
398
done ( ) ;
@@ -689,7 +737,7 @@ module.exports = {
689
737
expect ( config . outputPath ) . to . be . a . directory ( ) . with . deep . files ( [
690
738
'main.js' ,
691
739
'main.css' ,
692
- 'images/logo.png' ,
740
+ 'images/logo.82b9c7a5. png' ,
693
741
'manifest.json'
694
742
] ) ;
695
743
0 commit comments