Support the ongoing development of Laravel.io →
posted 11 years ago
Packages

Hello All,

Since December, I have been working on and improving an asset processing plugin that I have made for Laravel. I posted it on the old forums, but never re-posted once the forums were migrated over here. So I figured what better time than the present?

The main idea behind it was to kind of get the whole Laravel 3 feel with assets (being able to use Asset::add() to add in assets, and then Asset::styles() to emit them). However, I took it one step further!

With the latest release (1.0.7), it allows for the following:

  • Easy to add assets to the project (able to add assets single files at a time or in a folder)

  • Supports asset pre-processing and generation for the following:

    • LESS (via leafo/lessphp)
    • SASS (via leafo/scssphp)
    • CoffeeScript (via coffeescript/coffeescript)
  • Supports asset minimizing:

    • CSS (via natxet/CssMin)
    • JavaScript (via werkint/jsmin)
  • Allows for asset bundling by type

  • Environment aware to allow for easier debugging

  • Assets are cached until changes are made to the file and then automatically updated

    • Users get a unique URL each build, so you never have to worry about user's seeing older cached assets
  • Easy to extend in order to add in your own processors

  • Built-in commands to help clean up files that are no longer being used

  • CDN support

  • Internal/external file caching (i.e. either store all of the assets internal (outside of webroot) or externally (in webroot))

  • Asset auto-loading

Enough talking about the features and more talking about where to find it!

It's available on GitHub: https://github.com/awjudd/l4-assetprocessor

And on Packagist: "awjudd/assetprocessor"

You are able to install it via composer ("awjudd/assetprocessor": "1.0.*").

If you find any issues or suggestions please post them on GitHub! I am always looking for more things to add in!

Let me know what you think!

~awjudd

Last updated 3 years ago.
0

I don't see why is this a good way to load assets, b/c for every asset you load you need to boot whole framework.

Last updated 3 years ago.
0

It allows you to run processors and minifies the assets and then will normally drop the files out into web-root (assuming you give it write permissions). This means that you don't need to boot up the framework to access any of the assets.

It also generates file names based on the contents, so as the assets change, so do the file names. This means that you won't need to add things like ?v=2.0 or whatever to your asset files locally in order to implement cache-busting.

It also caches local versions of your assets throughout the process, that way if you have 1 out of several files that are changed, it only actually has to touch and re-generate that one file instead of re-processing the files each read.

~awjudd

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

awjudd awjudd Joined 1 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.