I have the following configuration:
framework:
assets:
base_urls:
- '%env(ASSETS_BASE_PATH)%'
According to the environment, ASSETS_BASE_PATH
can be a local folder or https://domain-with-assets
(a remote different domain).
When generating the assets path in HTML, I always get the Symfony service URL prefixed to the assets URL, resulting into: https://my-service.com/https://domain-with-assets/image.png
, resulting into assets not being correctly loaded.
(by checking the DOM, I can see a single /
prefixed all my assets URLs and I use importmap to load JS)
How not to have this prefix when the assets domain is totally different ?
1