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:
Supports asset minimizing:
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
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
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.
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
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community