PHPackages                             jbsnewmedia/asset-composer-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jbsnewmedia/asset-composer-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

jbsnewmedia/asset-composer-bundle
=================================

A Symfony bundle to help you manage your assets

1.1.7(4mo ago)12141MITPHPPHP &gt;=8.1CI passing

Since Aug 3Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/jbsnewmedia/asset-composer-bundle)[ Packagist](https://packagist.org/packages/jbsnewmedia/asset-composer-bundle)[ RSS](/packages/jbsnewmedia-asset-composer-bundle/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (4)Versions (16)Used By (1)

AssetComposerBundle
===================

[](#assetcomposerbundle)

[![Packagist Version](https://camo.githubusercontent.com/150adf29bf6e8cd707d6bd82f4bd6fe55efc1dca8598018d6173a59c7fe0fbf6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a62736e65776d656469612f61737365742d636f6d706f7365722d62756e646c65)](https://packagist.org/packages/jbsnewmedia/asset-composer-bundle)[![Packagist Downloads](https://camo.githubusercontent.com/4415e2c871e9addf06f7cbed587e4aaeab46d17c069302ed676fd0d011479374/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a62736e65776d656469612f61737365742d636f6d706f7365722d62756e646c65)](https://packagist.org/packages/jbsnewmedia/asset-composer-bundle)[![PHP Version Require](https://camo.githubusercontent.com/3e710186cc28e57fcbecaa5b901beb8ee76a081df226c6114a805ccce6711e84/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a62736e65776d656469612f61737365742d636f6d706f7365722d62756e646c65)](https://packagist.org/packages/jbsnewmedia/asset-composer-bundle)[![Symfony Version](https://camo.githubusercontent.com/6275f48b74f52d80ecf6318007b7d9d65ac917d52d711508bd8e5fbe1fe7303a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796d666f6e792d253545362e34253230253743253230253545372e302d3637336162373f6c6f676f3d73796d666f6e79)](https://symfony.com)[![License](https://camo.githubusercontent.com/e18a90a3c9755f6196a651bfead349c24c8af8b5d7f65d472a087b6ab8fa7ac0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a62736e65776d656469612f61737365742d636f6d706f7365722d62756e646c65)](https://packagist.org/packages/jbsnewmedia/asset-composer-bundle)[![Tests](https://github.com/jbsnewmedia/asset-composer-bundle/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/jbsnewmedia/asset-composer-bundle/actions/workflows/tests.yml)[![PHP CS Fixer](https://camo.githubusercontent.com/056e5fa4bcf9273c04257a42b6365d1d1f431d5ea1eae0c759754f8549af2b49/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2d63732d2d66697865722d636865636b65642d627269676874677265656e)](https://github.com/jbsnewmedia/asset-composer-bundle/actions/workflows/tests.yml)[![PHPStan](https://camo.githubusercontent.com/6e8e5bc365d34c98ba2b8b6caf2bdfaa5bccb21bc13931acc6e8717581207355/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068707374616e2d616e616c797365642d627269676874677265656e)](https://github.com/jbsnewmedia/asset-composer-bundle/actions/workflows/tests.yml)[![Rector](https://camo.githubusercontent.com/e74d169a31106980ccbf6ce8ae0436dc5a603c72c76c746a156282c07dd504b3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f726563746f722d636865636b65642d627269676874677265656e)](https://github.com/jbsnewmedia/asset-composer-bundle/actions/workflows/tests.yml)[![codecov](https://camo.githubusercontent.com/05c077e1aec65715ca56195231dff5fc0032174d5ee2d559f07d0be0b7b3d352/68747470733a2f2f636f6465636f762e696f2f67682f6a62736e65776d656469612f61737365742d636f6d706f7365722d62756e646c652f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/jbsnewmedia/asset-composer-bundle)

**AssetComposerBundle** is a Symfony bundle that helps you manage and serve assets directly from the `vendor` directory. It ensures all files are kept up-to-date by leveraging file modification timestamps for cache busting.

🚀 Features
----------

[](#-features)

- Manage CSS/JS assets via Composer packages
- Automatic versioning using file timestamps
- Simple integration with Twig templates
- Supports production/dev-only assets via `assetcomposer.json`
- Symfony 6 &amp; 7 compatible

---

⚙️ Requirements
---------------

[](#️-requirements)

- PHP 8.1 or higher
- Symfony Framework 6.4 or 7.0

---

📦 Installation
--------------

[](#-installation)

Use [Composer](https://getcomposer.org/) to install the bundle:

```
composer require jbsnewmedia/asset-composer-bundle
```

---

📋 Usage
-------

[](#-usage)

### 1. Install Asset Packages via Composer

[](#1-install-asset-packages-via-composer)

```
composer require twbs/bootstrap
composer require components/font-awesome
composer require avalynx/avalynx-alert
```

### 2. Register Assets in Twig Templates

[](#2-register-assets-in-twig-templates)

#### Assets from Composer Packages

[](#assets-from-composer-packages)

```
{% do addAssetComposer('twbs/bootstrap/dist/css/bootstrap.css') %}
{% do addAssetComposer('components/font-awesome/css/all.css') %}
{% do addAssetComposer('avalynx/avalynx-alert/dist/css/avalynx-alert.css') %}
{% do addAssetComposer('avalynx/avalynx-alert/dist/js/avalynx-alert.js') %}
```

#### Local Assets

[](#local-assets)

You can also use local assets stored in your project's `assets/` directory. Use the namespace `app` and the package `assets`:

```
{% do addAssetComposer('app/assets/css/custom.css') %}
{% do addAssetComposer('app/assets/js/custom.js') %}
```

The files must be located locally at `%kernel.project_dir%/assets/css/custom.css` and `%kernel.project_dir%/assets/js/custom.js` respectively.

Example file structure:

```
your-project/
├── assets/
│   ├── css/
│   │   └── custom.css
│   └── js/
│       └── custom.js
├── composer.json
└── ...

```

### 3. Render in Layout

[](#3-render-in-layout)

```

    {% block stylesheets %}
        {{ renderAssetComposerStylesheets() }}
    {% endblock %}

    {% block body %}{% endblock %}

    {% block javascripts %}
        {{ renderAssetComposerJavascripts() }}
    {% endblock %}

    {{ renderAssetComposerJavascripts('bottom') }}

```

---

📁 File Structure
----------------

[](#-file-structure)

```
config/
├── routes.yaml
├── services.yaml
src/
├── Controller/
│   └── AssetComposerController.php
├── DependencyInjection/
│   ├── AssetComposerExtension.php
│   └── Configuration.php
├── Service/
│   └── AssetComposer.php
├── Twig/
│   └── AssetComposerExtension.php
├── AssetComposerBundle.php

```

---

🧰 Configuration (Optional)
--------------------------

[](#-configuration-optional)

You can create an `assetcomposer.json` file in your asset packages to define which files should be exposed:

```
{
  "name": "library-name",
  "files": [
    "dist/css/styles.css",
    "dist/js/scripts.js"
  ],
  "files-dev": [
    "src/css/dev-styles.css",
    "src/js/dev-scripts.js"
  ]
}
```

---

🔧 Development Tools
-------------------

[](#-development-tools)

To maintain code quality, this project uses:

- **PHP-CS-Fixer (ECS)**: `composer bin-ecs`
- **PHPStan**: `composer bin-phpstan`
- **Rector**: `composer bin-rector`

Install and update tools using:

```
composer bin-ecs-install
composer bin-phpstan-install
composer bin-rector-install
composer bin-phpunit-install
```

---

🧪 Testing &amp; QA
------------------

[](#-testing--qa)

All code adheres to modern PHP standards. Use the provided scripts to analyze and refactor the codebase:

```
composer bin-phpstan       # Static analysis
composer bin-ecs           # Coding standards (check)
composer bin-ecs-fix       # Coding standards (fix)
composer bin-rector        # Code transformation (dry-run)
composer bin-rector-process # Code transformation (apply)
composer test              # Run tests
composer test-coverage     # Run tests with coverage
```

---

📜 License
---------

[](#-license)

This bundle is licensed under the MIT license. See the [LICENSE](LICENSE) file for more details.

Developed by Jürgen Schwind and other contributors.

---

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! If you'd like to contribute, please contact us or fork the repository and submit a pull request with your changes or improvements.

---

📫 Contact
---------

[](#-contact)

If you have any questions, feature requests, or issues, please open an issue on our [GitHub repository](https://github.com/jbsnewmedia/asset-composer-bundle) or submit a pull request.

---

*Always up-to-date. Simple. Composer-native asset management.*

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance77

Regular maintenance activity

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~42 days

Recently: every ~48 days

Total

14

Last Release

144d ago

PHP version history (2 changes)1.0.0PHP &gt;=8.0

1.1.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/44b85e5ce069ccae08123600bb24204ea8fe99c8cb5cbfae108ff29c179e503d?d=identicon)[jschwind](/maintainers/jschwind)

---

Top Contributors

[![jschwind](https://avatars.githubusercontent.com/u/985564?v=4)](https://github.com/jschwind "jschwind (55 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

assetasset-managementcomposersymfonysymfony-bundlesymfony6symfony7

### Embed Badge

![Health badge](/badges/jbsnewmedia-asset-composer-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/jbsnewmedia-asset-composer-bundle/health.svg)](https://phpackages.com/packages/jbsnewmedia-asset-composer-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[symfony/ux-toolkit

A tool to easily create a design system in your Symfony app with customizable, well-crafted Twig components

16126.1k1](/packages/symfony-ux-toolkit)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
