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 1717 ],
1818 ],
1919
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' => '/',
2230];
Original file line number Diff line number Diff line change @@ -78,13 +78,15 @@ protected function registerElixirLinks()
7878 {
7979 $ instance = app ('server-push ' );
8080
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 ' );
8384 if (file_exists ($ revPath )) {
8485 $ revMap = json_decode (file_get_contents ($ revPath ), true );
8586 if ($ revMap ) {
8687 foreach (array_values ($ revMap ) as $ path ) {
87- $ instance ->queueResource ('/build/ ' .ltrim ($ path , '/ ' ));
88+ $ assetUri = rtrim ($ assetsBaseUri , '/ ' ).'/ ' .ltrim ($ path , '/ ' );
89+ $ instance ->queueResource ($ assetUri );
8890 }
8991 }
9092 }
You can’t perform that action at this time.
0 commit comments