xp-forge / frontend

Web frontends
1 stars 1 forks source link

Support multiple sources in web.frontend.AssetsFrom #39

Closed thekid closed 10 months ago

thekid commented 10 months ago

This pull request adds the possibility to pass an array of paths which will be searched for the requested asset. The first path to provide the asset is selected, the file being served from there.

// Single source
$assets= new AssetsFrom($this->environment->path('src/main/webapp'));

// Multiple sources
$assets= new AssetsFrom([
  $this->environment->path('src/main/webapp'),
  $this->environment->path('vendor/example/layout-lib/src/main/webapp'),
]);
thekid commented 10 months ago

Released in https://github.com/xp-forge/frontend/releases/tag/v5.2.0