Assert Packager plugin
ruby script/plugin install http://sbecker.net/shared/plugins/asset_packager/
1. Download and install the plugin:
./script/plugin install http://sbecker.net/shared/plugins/asset_packager
2. Run the rake task "asset:packager:create_yml" to generate the /config/asset_packages.yml file the first time. You will need to reorder files under 'base' so dependencies are loaded in correct order. Feel free to rename or create new file packages.
Example from a fresh rails app after running the rake task. (Stylesheets is blank because a default rails app has no stylesheets yet.):
Example with multiple merged files:
3. Run the rake task "asset:packager:build_all" to generate the compressed, merged versions for each package. Whenever you rearrange the yaml file, you'll need to run this task again. Merging and compressing is expensive, so this is something we want to do once, not every time your app starts. Thats why its a rake task.
4. Use the helper functions whenever including these files in your application. See below for examples.
5. Potential warning: css compressor function currently removes CSS comments. This might blow away some CSS hackery. To disable comment removal, comment out /lib/synthesis/asset_package.rb line 176.
There is currently no advanced documentation for this plugin.New documentation