@@ -21,39 +21,67 @@ SensioLabs Minify Bundle integrates [Minify](https://github.com/tdewolff/minify)
2121
2222### Asset Minifier
2323
24- ✅ Minify ` CSS ` and ` JS ` files, remove whitespace, comments, and more..
24+ ✅ Minify ` CSS ` and ` JS ` files, remove whitespace, comments, and more..
2525
26- 🌍 🌍 Reduces the size of your assets by up to ` 70% ` (see metrics below).
26+ 🌍 Reduces the size of your assets by up to ` 70% ` (see metrics below).
2727
28- 🚀🚀🚀 Improves the loading time of your website, and the ` user experience ` .
28+ 🚀 Improves the loading time of your website, and the ` user experience ` .
2929
3030### Asset Mapper
3131
3232🎯 Automatically ` minify ` assets during the build process.
3333
34- 📦📦 Stores minified assets in the Symfony ` cache ` .
34+ 📦 Stores minified assets in the Symfony ` cache ` .
3535
36- 🌿🌿🌿 Download the Minify binary ` automatically ` from Github.
36+ 🌿 Download the Minify binary ` automatically ` from Github.
3737
3838## Minification
3939
4040### JavaScript
4141
42- | Asset | Before | After | Diff | Compression | Time |
43- | ------------------------| -------:| -------:| -----:| ------------------------------------------| ------:|
44- | [ Autocomplete.js] [ 1 ] | 20 kB | 9.2 kB | -54% | ⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 | 8 ms |
45- | [ Bootstrap.js] [ 3 ] | 145 kB | 62 kB | -57% | ⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 | 10 ms |
46- | [ Video.js] [ 5 ] | 2.3 MB | 0.7 MB | -71% | ⬜️⬜️⬜️⬜️⬜️⬜️🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 | 42 ms |
47- | [ w3c.org js] [ 7 ] | 44 kB | 19 kB | -57% | ⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 | 6 ms |
42+ | File | Original | Minified | Ratio | Gain | Compression | Time |
43+ | ----------------------| ----------:| ----------:| -------:| -------:| ---------------------:| ------:|
44+ | [ autocomplete.js] [ 1 ] | 19.88 KB | 9.17 KB | 46.13% | 53.87% | 🟩🟩🟩🟩🟩⬜️⬜️⬜️⬜️⬜️ | 8 ms |
45+ | [ bootstrap.js] [ 3 ] | 145.40 KB | 62.20 KB | 42.76% | 57.24% | 🟩🟩🟩🟩🟩🟩⬜️⬜️⬜️⬜️ | 10 ms |
46+ | [ video.js] [ 5 ] | 2.35 MB | 690.10 KB | 29.33% | 70.67% | 🟩🟩🟩🟩🟩🟩🟩⬜️⬜️⬜️ | 42 ms |
47+ | [ w3c.org js] [ 7 ] | 43.39 KB | 19.23 KB | 44.34% | 55.66% | 🟩🟩🟩🟩🟩🟩⬜️⬜️⬜️⬜️ | 6 ms |
48+
49+ Even gzip compression is more efficient on minified assets (see metrics below).
50+
51+ <details >
52+
53+ <summary > See transfert comparaison (gzip) </summary >
54+
55+ | File | Original | Minified | Ratio | Gain | Compression |
56+ | -----------------| -----------:| ----------:| -------:| -------:| ---------------------:|
57+ | autoComplete.js | 5.59 KB | 2.68 KB | 47.96% | 52.04% | 🟩🟩🟩🟩🟩⬜️⬜️⬜️⬜️⬜️ |
58+ | bootstrap.js | 29.92 KB | 12.58 KB | 42.06% | 57.94% | 🟩🟩🟩🟩🟩🟩⬜️⬜️⬜️⬜️ |
59+ | video.js | 538.83 KB | 202.62 KB | 37.61% | 62.39% | 🟩🟩🟩🟩🟩🟩⬜️⬜️⬜️⬜️ |
60+ | w3c.org.js | 10.44 KB | 5.89 KB | 56.45% | 43.55% | 🟩🟩🟩🟩⬜️⬜️⬜️⬜️⬜️⬜️ |
61+
62+ </details >
4863
4964### CSS
5065
51- | Asset | Before | After | Diff | Compression | Time |
52- | -----------------------| -------:| -------:| -----:| -------------------------------------------| -----:|
53- | [ Autocomplete.css] [ 2 ] | 3.1 kB | 2.5 kB | -19% | ⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️🟩🟩🟩🟩🟩 | 2 ms |
54- | [ Bootstrap.css] [ 4 ] | 281 kB | 232 kB | -18% | ⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️🟩🟩🟩🟩 | 9 ms |
55- | [ Video-js.css] [ 6 ] | 53 kB | 47 kB | -12% | ⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜⬜️⬜️⬜️⬜️⬜️⬜️⬜️️🟩🟩 | 4 ms |
56- | [ w3c.org css] [ 8 ] | 111 kB | 70 kB | -37% | ⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️🟩🟩🟩🟩🟩🟩🟩🟩 | 5 ms |
66+ | File | Original | Minified | Ratio | Gain | Compression | Time |
67+ | -----------------------| ----------:| ----------:| -------:| -------:| ---------------------:| -----:|
68+ | [ autocomplete.css] [ 2 ] | 3.09 KB | 2.51 KB | 81.33% | 18.67% | 🟩🟩⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️ | 2 ms |
69+ | [ bootstrap.css] [ 4 ] | 281.05 KB | 231.89 KB | 82.51% | 17.49% | 🟩🟩⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️ | 9 ms |
70+ | [ video-js.css] [ 6 ] | 53.37 KB | 47.06 KB | 88.24% | 11.76% | 🟩🟩⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️ | 4 ms |
71+ | [ w3c.org css] [ 8 ] | 111.44 KB | 70.37 KB | 63.17% | 36.83% | 🟩🟩🟩🟩⬜️⬜️⬜️⬜️⬜️⬜️ | 5 ms |
72+
73+ <details >
74+
75+ <summary > See transfert comparaison (gzip) </summary >
76+
77+ | File | Original | Minified | Ratio | Gain | Compression |
78+ | ------------------| -----------:| ----------:| -------:| -------:| ---------------------:|
79+ | autoComplete.css | 1.08 KB | 0.89 KB | 82.41% | 17.59% | 🟩🟩⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️ |
80+ | bootstrap.css | 33.56 KB | 28.94 KB | 86.08% | 13.92% | 🟩⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️ |
81+ | video-js.css | 13.14 KB | 12.72 KB | 96.79% | 3.21% | 🟩⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️ |
82+ | w3c.org.css | 21.98 KB | 13.65 KB | 62.13% | 37.87% | 🟩🟩🟩🟩⬜️⬜️⬜️⬜️⬜️⬜️ |
83+
84+ </details >
5785
5886## Installation
5987
@@ -71,6 +99,10 @@ composer require sensiolabs/minify-bundle
7199
72100### Without Symfony Flex
73101
102+ <details >
103+
104+ <summary > How to install without Symfony Flex</summary >
105+
74106#### Step 1: Download the Bundle
75107
76108Open a command console, enter your project directory and execute the
@@ -97,6 +129,8 @@ return [
97129Depending on your deployment process, you might want to enable the
98130bundle only in the desired environment(s).
99131
132+ </details >
133+
100134## Usage
101135
102136If you use [ AssetMapper] [ 9 ] , run the following command to minify all the assets:
@@ -130,7 +164,7 @@ php bin/console minify:asset css/main.css css/main.min.css
130164
131165## Configuration
132166
133- ### AssetMapper Settings
167+ ### AssetMapper
134168
135169``` yaml
136170# config/packages/sensiolabs_minify.yaml
@@ -154,6 +188,8 @@ sensiolabs_minify:
154188
155189### Minify Binary
156190
191+ #### Local binary
192+
157193The minification is performed by a binary file that can be installed on your
158194computer/server or downloaded automatically by the bundle. This is the default
159195configuration used by the bundle:
0 commit comments