Skip to content

Commit 37be281

Browse files
committed
Merge branch '6.4' into 7.1
* 6.4: [Frontend] Add some comments about minifying assets
2 parents 36ff79e + a72ab10 commit 37be281

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

frontend.rst

+10-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ Supports `Stimulus/UX`_ yes yes
3434
Supports Sass/Tailwind :ref:`yes <asset-mapper-tailwind>` yes
3535
Supports React, Vue, Svelte? yes :ref:`[1] <ux-note-1>` yes
3636
Supports TypeScript :ref:`yes <asset-mapper-ts>` yes
37-
Removes comments from JavaScript no yes
38-
Removes comments from CSS no no
37+
Removes comments from JavaScript no :ref:`[2] <ux-note-2>` yes
38+
Removes comments from CSS no :ref:`[2] <ux-note-2>` no
3939
Versioned assets always optional
40-
Can update 3rd party packages yes no :ref:`[2] <ux-note-2>`
40+
Can update 3rd party packages yes no :ref:`[3] <ux-note-2>`
4141
================================ ================================== ==========
4242

4343
.. _ux-note-1:
@@ -49,7 +49,12 @@ be executed by a browser.
4949

5050
.. _ux-note-2:
5151

52-
**[2]** If you use ``npm``, there are update checkers available (e.g. ``npm-check``).
52+
**[2]** You can install the `SensioLabs Minify Bundle`_ to minify CSS/JS code
53+
(and remove all comments) when compiling assets with AssetMapper.
54+
55+
.. _ux-note-3:
56+
57+
**[3]** If you use ``npm``, there are update checkers available (e.g. ``npm-check``).
5358

5459
.. _frontend-asset-mapper:
5560

@@ -137,3 +142,4 @@ Other Front-End Articles
137142
.. _`Turbo`: https://turbo.hotwired.dev/
138143
.. _`Symfony UX`: https://ux.symfony.com
139144
.. _`API Platform`: https://api-platform.com/
145+
.. _`SensioLabs Minify Bundle`: https://github.com/sensiolabs/minify-bundle

frontend/asset_mapper.rst

+11-3
Original file line numberDiff line numberDiff line change
@@ -700,9 +700,16 @@ See :ref:`Optimization <optimization>` for more details.
700700
Does the AssetMapper Component Minify Assets?
701701
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
702702

703-
Nope! Minifying or compressing assets *is* important, but can be
704-
done by your web server. See :ref:`Optimization <optimization>` for
705-
more details.
703+
Nope! In most cases, this is perfectly fine. The web asset compression performed
704+
by web servers before sending them is usually sufficient. However, if you think
705+
you could benefit from minifying assets (in addition to later compressing them),
706+
you can use the `SensioLabs Minify Bundle`_.
707+
708+
This bundle integrates seamlessly with AssetMapper and minifies all web assets
709+
automatically when running the ``asset-map:compile`` command (as explained in
710+
the :ref:`serving assets in production <asset-mapper-compile-assets>` section).
711+
712+
See :ref:`Optimization <optimization>` for more details.
706713

707714
Is the AssetMapper Component Production Ready? Is it Performant?
708715
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1144,3 +1151,4 @@ command as part of your CI to be warned anytime a new vulnerability is found.
11441151
.. _Content Security Policy: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
11451152
.. _NelmioSecurityBundle: https://symfony.com/bundles/NelmioSecurityBundle/current/index.html#nonce-for-inline-script-handling
11461153
.. _kocal/biome-js-bundle: https://github.com/Kocal/BiomeJsBundle
1154+
.. _`SensioLabs Minify Bundle`: https://github.com/sensiolabs/minify-bundle

0 commit comments

Comments
 (0)