Create a symfony bundle with the following things in it:
View helpers, e.g. asset_link
Renders tags according to asset content type, e.g. <link> for text/css or <script> for application/javascript
In development, asset URI points to the asset controller, which dynamically compiles assets.
In production, asset URI points to the asset's digest name (read from the manifest) prefixed with a configured path (could be CDN URI)
Command pipe:assets:precompile, which dumps assets to a directory with cache digests and a cache manifest in it (for an example implementation see bob/pipe_tasks.php)
The manifest should be a simple JSON file, with the logical path of each compiled asset as the key and the logical path with digests in it as the value. This file gets deployed to production's asset prefix and is used for figuring out the asset paths for production in the view helper.
Controller for dynamic asset compilation for development environments. Assets should be accessible via /pipe/asset/{asset}.
Environment exposed via DI container
Constructing the Pipe\Config via Symfony's configuration system.
Create a symfony bundle with the following things in it:
asset_link
<link>
fortext/css
or<script>
forapplication/javascript
pipe:assets:precompile
, which dumps assets to a directory with cache digests and a cache manifest in it (for an example implementation seebob/pipe_tasks.php
)/pipe/asset/{asset}
.Pipe\Config
via Symfony's configuration system.