What is assets-packager?
CSS bundles are created from assets which are:
- compiled from LESS templates (optional),
- minified using clean-css,
- preprocessed via enhance-css (inline images, asset hosts, etc),
- and packaged (and optionally precompressed).
- minified using UglifyJS,
- and packaged (and optionally precompressed)
What are the requirements?
node.js 0.8.0+ on *nix (fully tested on OS X 10.6+ and CentOS) and Windows
How to install assets-packager?
npm install -g assets-packager
Tl;dr. Give me a quick demo!
OK. Here are commands to run
git clone email@example.com:jakubpawlowicz/assets-packager.git cd assets-packager/examples assetspkg -c assets.yml -g
Is it fast?
You should have just witnessed it by yourself. :-)
So yes, it is fast!
How to use assets-packager in my application?
First of all it assumes Rails-like directory structure for your assets, e.g:
- some scripts
- some styles
Then it needs a configuration file (here we name it assets.yml) with a definition of JS/CSS bundles, e.g:
We recommend placing it somewhere else than in your public folder.
Now you can bundle all these packages with a single command:
assetspkg -c assets.yml
How to use assets-packager CLI?
Assets-packager accepts the following command line arguments:
What are the assets-packager's dev commands?
First clone the source, then run:
npm run checkto check JS sources with JSHint
npm testfor the test suite
The feature I want is not there!
Open an issue. Or better: fork the project, add the feature (don't forget about tests!) and send a pull request.
- Jean-Denis Vauguet @chikamichi -
--indentoptions allow for combination-only processing.
Assets-packager is released under the MIT License.