PHPackages                             fortrabbit/craft-asset-bundler - 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. [CLI &amp; Console](/categories/cli)
4. /
5. fortrabbit/craft-asset-bundler

AbandonedArchivedCraft-plugin[CLI &amp; Console](/categories/cli)

fortrabbit/craft-asset-bundler
==============================

Provides a console command to publish web/cpresources

0.6.0(8y ago)51.8k1[1 issues](https://github.com/fortrabbit/craft-asset-bundler/issues)MITPHP

Since Apr 10Pushed 7y agoCompare

[ Source](https://github.com/fortrabbit/craft-asset-bundler)[ Packagist](https://packagist.org/packages/fortrabbit/craft-asset-bundler)[ RSS](/packages/fortrabbit-craft-asset-bundler/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Deprecated since craftcms/cms: 3.0.13 (2018-06-26)
==================================================

[](#deprecated-since-craftcmscms-3013-2018-06-26)

The plugin is not needed anymore. In Craft 3.0.4 the way cpresources are published was changed. In Craft 3.0.13 another fix was released to change thumbnail delivery in the CP as well.

AssetBundler plugin for Craft CMS 3.x
=====================================

[](#assetbundler-plugin-for-craft-cms-3x)

The plugin provides a console command to publish web/cpresources. This is useful in "cloud environments" like [fortrabbit's Professional Stack](https://www.fortrabbit.com/pricing-pro) or when using multiple Dynos on Heroku.

The purpose of this command is to publish AssetBundles files in a publicly accessible `/web` directory. This happens already on-the-fly, e.g when you access Craft's control panel in the browser the first time. However, in load balanced environments, it happens that files do not exist on all servers after you deployed.

Craft also stores thumbnails of Volume Assets in `web/cpresources` to make them accessible in the control panel. The plugin changes this behaviour:

- (default pattern) `web/cpresources/{hash}/thumb-{width}x{height}.{ext}?v={modified_date}`
- (modified pattern) `web/t/{asset_id}/thumb-{width}x{height}.{ext}?v={modified_date}`

This way we can create thumbnails on-the-fly if they don't exist on a certain server.

Usage
=====

[](#usage)

Use this command in your build process before you distribute your code to all servers:

```
php craft asset-bundler/publish

```

When `composer install` is part of your deployment process anyways, you can include the command in your composer.json to run it automatically:

```
"scripts": {
    "post-install-cmd": [
      "@php craft install/plugin asset-bundler",
      "@php craft asset-bundler/publish"
    ]
  }

```

How it works
============

[](#how-it-works)

- All `AssetBundle` classes that exist in the composer autoload class map get registered.
- In a `/web/cpresources.rev` file the timestamp of the latest revision is stored
- Files are located in `web/cpresources/{revision}/{hash}/file.ext`
- `{revision}` only changes if file is modified

Edge cases
==========

[](#edge-cases)

The `craft\web\AssetManager::getPublishedUrl()` method allows to publish single files that are not part of an `AssetBundle`. As the plugin is not aware of these files, you may need to add them to a bundle.

TODOs
=====

[](#todos)

- Config option to include additional classes
- Config option to exclude classes form class map

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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 ~1 days

Total

2

Last Release

2953d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f2939b15a562ee53b5284f58b704e53ae26b975c1154fa6afb2f8b8331fbd27?d=identicon)[ostark](/maintainers/ostark)

---

Tags

assetscraft-plugincraft3craftcmscmsCraftcraftcmscraft-pluginasset bundlecpresource

### Embed Badge

![Health badge](/badges/fortrabbit-craft-asset-bundler/health.svg)

```
[![Health](https://phpackages.com/badges/fortrabbit-craft-asset-bundler/health.svg)](https://phpackages.com/packages/fortrabbit-craft-asset-bundler)
```

###  Alternatives

[nystudio107/craft-seomatic

SEOmatic facilitates modern SEO best practices &amp; implementation for Craft CMS 5. It is a turnkey SEO system that is comprehensive, powerful, and flexible.

1741.4M46](/packages/nystudio107-craft-seomatic)[verbb/image-resizer

Resize assets when they are uploaded.

127269.1k7](/packages/verbb-image-resizer)[verbb/tablemaker

Create customizable and user-defined table fields.

40168.8k1](/packages/verbb-tablemaker)[verbb/hyper

A user-friendly links field for Craft.

24130.9k9](/packages/verbb-hyper)[verbb/social-poster

Automatically post entries to social media.

918.5k](/packages/verbb-social-poster)[acclaro/translations

Easily launch and manage multilingual Craft websites without having to copy/paste content or manually track updates.

1229.5k](/packages/acclaro-translations)

PHPackages © 2026

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