Symfony News

New in Symfony 5.1: Remote asset manifest

Jérôme Tamarelle

Contributed by
Jérôme Tamarelle
in #35762.

Webpack Encore is a pure-JavaScript library developed by Symfony as a simpler way to integrate Webpack into your application. When building assets, Webpack Encore creates a manifest.json file listing all the generated assets (and their versioning).

In Symfony 5.1, we've improved this feature to allow using manifest files stored in other servers and retrieved via HTTP requests. This is useful when using CDNs (content delivery networks) to server your assets.

You don't need to add or enable any option to use this new feature. Just update the value of your existing json_manifest_path option and use an absolute URL. Symfony will make an HTTP request automatically to retrieve the manifest:

1
2
3
4
# config/packages/assets.yaml
framework:
    assets:
        json_manifest_path: 'https://cdn.example.com/manifest.json'

Sponsor the Symfony project.


About us

What a Symfony developer should know about the framework: News, Jobs, Tweets, Events, Videos,...

Resources

Find us on Twitter

Find us on Facebook