Skip to content

Commit ec26fd2

Browse files
[AssetMapper] Adding info about deleting compiled assets
Page: https://symfony.com/doc/6.4/frontend/asset_mapper.html#serving-assets-in-dev-vs-prod First: I'm not sure if this is really true for any (local server) configuration - I took the info from `asset-map:compile`s warning message (which I'm trying to improve in symfony/symfony#54106 BTW) The message I'm trying to get across: I've you're doing this on your dev machine (as part of the deploy process), you should set up a process that deletes those files afterwards! Maybe this should be repeated at https://symfony.com/doc/6.4/frontend/asset_mapper.html#deploying-with-the-assetmapper-component again? Or should those two heading even be merged?
1 parent 37b4d00 commit ec26fd2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

frontend/asset_mapper.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Serving Assets in dev vs prod
8181
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8282

8383
In the ``dev`` environment, the URL ``/assets/images/duck-3c16d9220694c0e56d8648f25e6035e9.png``
84-
is handled and returned by your Symfony app.
84+
is handled and returned by your Symfony app - but only if ``public/assets/`` is empty (see below).
8585

8686
For the ``prod`` environment, before deploy, you should run:
8787

@@ -93,6 +93,9 @@ This will physically copy all the files from your mapped directories to
9393
``public/assets/`` so that they're served directly by your web server.
9494
See :ref:`Deployment <asset-mapper-deployment>` for more details.
9595

96+
If you compiled your assets on your development machine, you need to delete them again,
97+
in order to make Symfony serve the current versions from ``assets/`` again.
98+
9699
.. tip::
97100

98101
If you need to copy the compiled assets to a different location (e.g. upload

0 commit comments

Comments
 (0)