Skip to content

Commit 6e006ab

Browse files
committed
minor #10792 Update encore/copy-files.rst: add note about using versioning with custom target path (mhujer)
This PR was merged into the 3.4 branch. Discussion ---------- Update encore/copy-files.rst: add note about using versioning with custom target path Improving https://symfony.com/doc/current/frontend/encore/copy-files.html#referencing-image-files-from-a-template If the versioning is enabled in Encore and you want to use custom target path, you need to manually include the hash in the target filename. <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- 1a33da0 Update encore/copy-files.rst: add note about using versioning with custom target path
2 parents ac29a8b + 1a33da0 commit 6e006ab

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

frontend/encore/copy-files.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ This will copy all files from ``assets/images`` into ``web/build`` (the output
5252
path). If you have :doc:`versioning enabled <versioning>`, the copied files will
5353
include a hash based on their content.
5454

55+
.. note::
56+
57+
If order to use versioning with with custom target path (``to``), you need to
58+
update to path to include the file hash: ``images/[path][name].[hash:8].[ext]``.
59+
5560
To render inside Twig, use the ``asset()`` function:
5661

5762
.. code-block:: html+twig

0 commit comments

Comments
 (0)