{"id":17495426,"url":"https://github.com/sensiolabs/minify-bundle","last_synced_at":"2025-04-05T14:04:24.634Z","repository":{"id":258320512,"uuid":"874374418","full_name":"sensiolabs/minify-bundle","owner":"sensiolabs","description":"Asset Minifier for Symfony Asset Mapper - Made by SensioLabs","archived":false,"fork":false,"pushed_at":"2025-01-06T00:13:00.000Z","size":61,"stargazers_count":45,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-03T02:15:39.347Z","etag":null,"topics":["asset-mapper","assets","css","css-minifier","js","js-minifier","minifier","minify","pagespeed","performance","php","php-css","php-minify","symfony","symfony-bundle","uglify"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sensiolabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-17T17:59:33.000Z","updated_at":"2025-02-15T13:36:14.000Z","dependencies_parsed_at":"2024-11-22T07:23:38.983Z","dependency_job_id":"b4a70e14-8529-44ec-9868-47a84f4a659e","html_url":"https://github.com/sensiolabs/minify-bundle","commit_stats":{"total_commits":13,"total_committers":4,"mean_commits":3.25,"dds":"0.23076923076923073","last_synced_commit":"5a07acd097476014df99bb06bee8b4e08d90156e"},"previous_names":["sensiolabs/minify-bundle"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensiolabs%2Fminify-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensiolabs%2Fminify-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensiolabs%2Fminify-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensiolabs%2Fminify-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sensiolabs","download_url":"https://codeload.github.com/sensiolabs/minify-bundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345850,"owners_count":20924102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asset-mapper","assets","css","css-minifier","js","js-minifier","minifier","minify","pagespeed","performance","php","php-css","php-minify","symfony","symfony-bundle","uglify"],"created_at":"2024-10-19T14:06:02.143Z","updated_at":"2025-04-05T14:04:24.615Z","avatar_url":"https://github.com/sensiolabs.png","language":"PHP","readme":"\u003ch1 align=center\u003eSensioLabs Minify Bundle\u003c/h1\u003e\n\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: light)\" srcset=\"./minify.svg\" /\u003e\n\u003cimg src=\"./minify.dark.svg\" alt=\"SensioLabs Minify Bundle for Symfony\" width=\"100%\" /\u003e\u003c/picture\u003e\n\u003cdiv align=\"center\"\u003e\u003cpre\u003ecomposer require sensiolabs/minify-bundle\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n\n[![PHP Version](https://img.shields.io/badge/%C2%A0php-%3E%3D%208.2-777BB4.svg?logo=php\u0026logoColor=white)](https://github.com/sensiolabs/minify-bundle/blob/main/composer.json)\n[![CI](https://github.com/sensiolabs/minify-bundle/actions/workflows/CI.yaml/badge.svg?color=68c22e)](https://github.com/sensiolabs/minify-bundle/actions)\n[![Release](https://img.shields.io/github/v/release/sensiolabs/minify-bundle?color=31a6ce)](https://github.com/sensiolabs/minify-bundle/releases)\n[![Packagist Downloads](https://img.shields.io/packagist/dt/sensiolabs/minify-bundle?color=ce8531)](https://github.com/sensiolabs/minify-bundle/)\n[![License](https://img.shields.io/github/license/sensiolabs/minify-bundle?color=d3416f)](https://github.com/sensiolabs/minify-bundle/blob/main/LICENSE)\n\n\u003c/div\u003e\n\n\u003c!-- ☘️ If you find this bundle helpful, feel free to show your appreciation by starring the repository on GitHub or \nsending a message to the author. Thank you! ☘️ --\u003e\n\n## Minify integration\n\nSensioLabs Minify Bundle integrates [Minify](https://github.com/tdewolff/minify) into Symfony Asset Mapper.\n\n### Asset Minifier\n\n✅ Minify `CSS` and `JS` files, remove whitespace, comments, and more..\n\n🌍 Reduces the size of your assets by up to `70%` (see metrics below).  \n\n🚀 Improves the loading time of your website, and the `user experience`.     \n\n### Asset Mapper\n\n🎯 Automatically `minify` assets during the build process.   \n\n📦 Stores minified assets in the Symfony `cache`. \n\n🌿 Download the Minify binary `automatically` from Github.\n \n## Minification\n\n### JavaScript\n\n| File                 |  Original |  Minified |  Ratio |   Gain |          Compression |  Time |\n|----------------------|----------:|----------:|-------:|-------:|---------------------:|------:|\n| [autocomplete.js][1] |  19.88 KB |   9.17 KB | 46.13% | 53.87% | 🟩🟩🟩🟩🟩⬜️⬜️⬜️⬜️⬜️ |  8 ms |\n| [bootstrap.js][3]    | 145.40 KB |  62.20 KB | 42.76% | 57.24% | 🟩🟩🟩🟩🟩🟩⬜️⬜️⬜️⬜️ | 10 ms |\n| [video.js][5]        |   2.35 MB | 690.10 KB | 29.33% | 70.67% | 🟩🟩🟩🟩🟩🟩🟩⬜️⬜️⬜️ | 42 ms |\n| [w3c.org js][7]      |  43.39 KB |  19.23 KB | 44.34% | 55.66% | 🟩🟩🟩🟩🟩🟩⬜️⬜️⬜️⬜️ |  6 ms |\n\nEven gzip compression is more efficient on minified assets (see metrics below).\n\n\u003cdetails\u003e\n\n\u003csummary\u003e See transfer comparison (gzip) \u003c/summary\u003e\n\n| File            |   Original |  Minified |  Ratio |   Gain |          Compression |\n|-----------------|-----------:|----------:|-------:|-------:|---------------------:|\n| autoComplete.js |    5.59 KB |   2.68 KB | 47.96% | 52.04% | 🟩🟩🟩🟩🟩⬜️⬜️⬜️⬜️⬜️ |\n| bootstrap.js    |   29.92 KB |  12.58 KB | 42.06% | 57.94% | 🟩🟩🟩🟩🟩🟩⬜️⬜️⬜️⬜️ |\n| video.js        |  538.83 KB | 202.62 KB | 37.61% | 62.39% | 🟩🟩🟩🟩🟩🟩⬜️⬜️⬜️⬜️ |\n| w3c.org.js      |   10.44 KB |   5.89 KB | 56.45% | 43.55% | 🟩🟩🟩🟩⬜️⬜️⬜️⬜️⬜️⬜️ |\n\n\u003c/details\u003e\n\n### CSS\n\n| File                  |  Original |  Minified |  Ratio |   Gain |          Compression | Time |\n|-----------------------|----------:|----------:|-------:|-------:|---------------------:|-----:|\n| [autocomplete.css][2] |   3.09 KB |   2.51 KB | 81.33% | 18.67% | 🟩🟩⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️ | 2 ms |\n| [bootstrap.css][4]    | 281.05 KB | 231.89 KB | 82.51% | 17.49% | 🟩🟩⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️ | 9 ms |\n| [video-js.css][6]     |  53.37 KB |  47.06 KB | 88.24% | 11.76% | 🟩🟩⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️ | 4 ms |\n| [w3c.org css][8]      | 111.44 KB |  70.37 KB | 63.17% | 36.83% | 🟩🟩🟩🟩⬜️⬜️⬜️⬜️⬜️⬜️ | 5 ms |\n\n\u003cdetails\u003e\n\n\u003csummary\u003e See transfer comparison (gzip) \u003c/summary\u003e\n\n| File             |   Original |  Minified |  Ratio |   Gain |          Compression |\n|------------------|-----------:|----------:|-------:|-------:|---------------------:|\n| autoComplete.css |    1.08 KB |   0.89 KB | 82.41% | 17.59% | 🟩🟩⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️ |\n| bootstrap.css    |   33.56 KB |  28.94 KB | 86.08% | 13.92% | 🟩⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️ |\n| video-js.css     |   13.14 KB |  12.72 KB | 96.79% |  3.21% | 🟩⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️ |\n| w3c.org.css      |   21.98 KB |  13.65 KB | 62.13% | 37.87% | 🟩🟩🟩🟩⬜️⬜️⬜️⬜️⬜️⬜️ |\n\n\u003c/details\u003e\n\n## Installation\n\nMake sure Composer is installed globally, as explained in the\n[installation chapter](https://getcomposer.org/doc/00-intro.md)\nof the Composer documentation.\n\n### With Symfony Flex\n\nOpen a command console, enter your project directory and execute:\n\n```shell\ncomposer require sensiolabs/minify-bundle\n```\n\n### Without Symfony Flex\n\n\u003cdetails\u003e\n\n\u003csummary\u003e How to install without Symfony Flex\u003c/summary\u003e\n\n#### Step 1: Download the Bundle\n\nOpen a command console, enter your project directory and execute the\nfollowing command to download the latest stable version of this bundle:\n\n```shell\ncomposer require sensiolabs/minify-bundle\n```\n\n#### Step 2: Enable the Bundle\n\nThen, enable the bundle by adding it to the list of registered bundles\nin the `config/bundles.php` file of your project:\n\n```php\n// config/bundles.php\n\nreturn [\n    // ...\n    Sensiolabs\\MinifyBundle\\SensiolabsMinifyBundle::class =\u003e ['all' =\u003e true],\n];\n```\n\nDepending on your deployment process, you might want to enable the \nbundle only in the desired environment(s).\n\n\u003c/details\u003e\n\n## Usage\n\nIf you use [AssetMapper][9], run the following command to minify all the assets:\n\n```shell\nphp bin/console asset-map:compile\n```\n\nThis command is usually run when [serving assets in production][10] and the\nSensioLabs Minify Bundle will hook into it to minify all assets while copying them.\n\n### Command Line\n\nYou can also minify assets manually with the command line. First, make sure that\nthe binary file used to minify assets is properly installed in your computer:\n\n```shell\nphp bin/console minify:install\n```\n\nThen, run the following command to minify assets:\n\n```shell\n# this outputs the result in the console\nphp bin/console minify:asset css/main.css\n\n# this will write the output into the 'main.min.css' file\n# (the given output file is created / overwritten if needed)\nphp bin/console minify:asset css/main.css css/main.min.css\n```\n\n## Configuration\n\n### AssetMapper\n\n```yaml\n# config/packages/sensiolabs_minify.yaml\nsensiolabs_minify:\n    asset_mapper:\n        # you can minify only CSS files, only JS files or both\n        types:\n            css: true # (default: true)\n            js:  true # (default: true)\n\n        # a list of assets to exclude from minification (default: [])\n        # the values of the list can be any shell wildcard patterns\n        ignore_paths:\n            - 'admin/*'\n            - '*.min.js'\n\n        # whether to exclude the assets stored in vendor/ from minification;\n        # these assets are usually pre-minified, so it's common to exclude them\n        ignore_vendor: true # (default: true)\n```\n\n### Minify Binary\n\n#### Local binary\n\nThe minification is performed by a binary file that can be installed on your\ncomputer/server or downloaded automatically by the bundle. This is the default\nconfiguration used by the bundle:\n\n```yaml\n# config/packages/sensiolabs_minify.yaml\nsensiolabs_minify:\n    # ...\n\n    minify:\n        # this disables the usage of local binaries\n        local_binary: false\n\n        # if TRUE, the bundle will download the binary from GitHub\n        download_binary: '%kernel.debug%'\n\n        # the local path where the downloaded binary is stored\n        download_directory: '%kernel.project_dir%/var/minify'\n```\n\nYou can customize this configuration to use a local binary:\n\n```yaml\n# config/packages/sensiolabs_minify.yaml\nsensiolabs_minify:\n    # ...\n\n    minify:\n        # set it to 'auto' to let the bundle try to find the location of the binary\n        local_binary: 'auto'\n\n        # you can also define the path to the binary explicitly, but this won't work\n        # if you run the application in multiple servers with different binary locations\n        local_binary: \"/usr/local/bin/minify\"\n```\n\n## Credits\n\n### Authors\n\n- MinifyBundle: [Simon André](https://github.com/smnandre) \u0026 [SensioLabs](https://github.com/sensiolabs)\n- Minify binary: [Timo Dewolf](https://github.com/tdewolff)\n\n### Acknowledgments\n\nThis bundle is inspired by the following projects:\n\n- [SassBundle](https://github.com/SymfonyCasts/sass-bundle) from @SymfonyCasts\n- [BiomejsBundle](https://github.com/Kocal/BiomeJsBundle) from @Kocal\n- [TypeScriptBundle](https://github.com/sensiolabs/AssetMapperTypeScriptBundle) from @SensioLabs\n\n### Contributors\n\nSpecial thanks to the Symfony community for their contributions and feedback.\n\n## License\n\nThe [SensioLabs Minify Bundle](https://github.com/sensiolabs/minify-bundle) is released under the [MIT license](LICENSE).\n\n[1]: https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.7/dist/autoComplete.js\n[3]: https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.js\n[5]: https://cdn.jsdelivr.net/npm/video.js@8.18.1/dist/video.js\n[7]: https://github.com/w3c/w3c-website-templates-bundle/blob/main/public/dist/assets/js/main.js\n[2]: https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.7/dist/css/autoComplete.css\n[4]: https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.css\n[6]: https://cdn.jsdelivr.net/npm/video.js@8.18.1/dist/video-js.css\n[8]: https://github.com/w3c/w3c-website-templates-bundle/blob/main/public/dist/assets/styles/core.css\n[9]: https://symfony.com/doc/current/frontend/asset_mapper.html\n[10]: https://symfony.com/doc/current/frontend/asset_mapper.html#serving-assets-in-dev-vs-prod\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensiolabs%2Fminify-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsensiolabs%2Fminify-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensiolabs%2Fminify-bundle/lists"}