20
20
21
21
final class WebpackEncoreExtension extends Extension
22
22
{
23
+ private const ENTRYPOINTS_FILE_NAME = 'entrypoints.json ' ;
24
+
23
25
public function load (array $ configs , ContainerBuilder $ container )
24
26
{
25
27
$ loader = new XmlFileLoader ($ container , new FileLocator (\dirname (__DIR__ ).'/Resources/config ' ));
@@ -32,11 +34,11 @@ public function load(array $configs, ContainerBuilder $container)
32
34
'_default ' => $ this ->entrypointFactory ($ container , '_default ' , $ config ['output_path ' ], $ config ['cache ' ]),
33
35
];
34
36
$ cacheKeys = [
35
- '_default ' => $ config ['output_path ' ].'/entrypoints.json ' ,
37
+ '_default ' => $ config ['output_path ' ].'/ ' . self :: ENTRYPOINTS_FILE_NAME ,
36
38
];
37
39
foreach ($ config ['builds ' ] as $ name => $ path ) {
38
40
$ factories [$ name ] = $ this ->entrypointFactory ($ container , $ name , $ path , $ config ['cache ' ]);
39
- $ cacheKeys [rawurlencode ($ name )] = $ path ;
41
+ $ cacheKeys [rawurlencode ($ name )] = $ path. ' / ' . self :: ENTRYPOINTS_FILE_NAME ;
40
42
}
41
43
42
44
$ container ->getDefinition ('webpack_encore.entrypoint_lookup.cache_warmer ' )
@@ -49,7 +51,7 @@ public function load(array $configs, ContainerBuilder $container)
49
51
private function entrypointFactory (ContainerBuilder $ container , string $ name , string $ path , bool $ cacheEnabled ): Reference
50
52
{
51
53
$ id = sprintf ('webpack_encore.entrypoint_lookup[%s] ' , $ name );
52
- $ arguments = [$ path .'/entrypoints.json ' , $ cacheEnabled ? new Reference ('webpack_encore.cache ' ) : null , $ name ];
54
+ $ arguments = [$ path .'/ ' . self :: ENTRYPOINTS_FILE_NAME , $ cacheEnabled ? new Reference ('webpack_encore.cache ' ) : null , $ name ];
53
55
$ container ->setDefinition ($ id , new Definition (EntrypointLookup::class, $ arguments ));
54
56
55
57
return new Reference ($ id );
0 commit comments