@@ -42,7 +42,7 @@ files into your final output directory. First enable it in ``webpack.config.js``
4242 + from: './assets/images',
4343 +
4444 + // optional target path, relative to the output dir
45- + // to: 'images/[path][name].[ext]',
45+ + to: 'images/[path][name].[ext]',
4646 +
4747 + // if versioning is enabled, add the file hash too
4848 + //to: 'images/[path][name].[hash:8].[ext]',
@@ -55,19 +55,19 @@ Then restart Encore. When you do, it will give you a command you can run to
5555install any missing dependencies. After running that command and restarting
5656Encore, you're done!
5757
58- This will copy all files from ``assets/images `` into ``public/build `` (the output
59- path). If you have :doc: `versioning enabled <versioning >`, the copied files will
58+ This will copy all files from ``assets/images `` into ``public/build/images ``.
59+ If you have :doc: `versioning enabled <versioning >`, the copied files will
6060include a hash based on their content.
6161
6262To render inside Twig, use the ``asset() `` function:
6363
6464.. code-block :: html+twig
6565
66- {# assets/images/logo.png was copied to public/build/logo.png #}
67- <img src="{{ asset('build/logo.png') }}" alt="ACME logo">
66+ {# assets/images/logo.png was copied to public/build/images/ logo.png #}
67+ <img src="{{ asset('build/images/ logo.png') }}" alt="ACME logo">
6868
69- {# assets/images/subdir/logo.png was copied to public/build/subdir/logo.png #}
70- <img src="{{ asset('build/subdir/logo.png') }}" alt="ACME logo">
69+ {# assets/images/subdir/logo.png was copied to public/build/images/ subdir/logo.png #}
70+ <img src="{{ asset('build/images/ subdir/logo.png') }}" alt="ACME logo">
7171
7272Make sure you've enabled the :ref: `json_manifest_path <load-manifest-files >` option,
7373which tells the ``asset() `` function to read the final paths from the ``manifest.json ``
0 commit comments