File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 17
17
],
18
18
],
19
19
20
- // Auto link all files that are built with elixir
21
- 'autolink_elixir ' => true ,
20
+ // Auto link all files from your built manifest
21
+ 'autolink_from_manifest ' => true ,
22
+
23
+ // Elixir example
24
+ 'manifest_path ' => public_path ('build/rev-manifest.json ' ),
25
+ 'assets_base_uri ' => '/build/ ' ,
26
+
27
+ // Mix example
28
+ //'manifest_path' => public_path('mix-manifest.json'),
29
+ //'assets_base_uri' => '/',
22
30
];
Original file line number Diff line number Diff line change @@ -78,13 +78,15 @@ protected function registerElixirLinks()
78
78
{
79
79
$ instance = app ('server-push ' );
80
80
81
- if (config ('server-push.autolink_elixir ' )) {
82
- $ revPath = public_path ().'/build/rev-manifest.json ' ;
81
+ if (config ('server-push.autolink_from_manifest ' )) {
82
+ $ revPath = config ('server-push.manifest_path ' );
83
+ $ assetsBaseUri = config ('server-push.assets_base_uri ' );
83
84
if (file_exists ($ revPath )) {
84
85
$ revMap = json_decode (file_get_contents ($ revPath ), true );
85
86
if ($ revMap ) {
86
87
foreach (array_values ($ revMap ) as $ path ) {
87
- $ instance ->queueResource ('/build/ ' .ltrim ($ path , '/ ' ));
88
+ $ assetUri = rtrim ($ assetsBaseUri , '/ ' ).'/ ' .ltrim ($ path , '/ ' );
89
+ $ instance ->queueResource ($ assetUri );
88
90
}
89
91
}
90
92
}
You can’t perform that action at this time.
0 commit comments