Skip to content

This little guard allows you to concatenate js/css (or other) files in one.

License

Notifications You must be signed in to change notification settings

geoffyoungs/guard-concat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Guard::Concat

This little guard allows you to concatenate js/css (or other) files in one.

Install

Make sure you have guard installed.

Install the gem with:

gem install guard-concatfilter

Or add it to your Gemfile:

gem 'guard-concatfilter'

And then add a basic setup to your Guardfile:

guard init concat

Usage

# This will concatenate the javascript files a.js and b.js in public/js to all.js
guard :concatfilter, type: "js", files: %w(b a), input_dir: "public/js", output: "public/js/all"

# analog css example
guard :concatfilter, type: "css", files: %w(c d), input_dir: "public/css", output: "public/css/all"

# js example with *

guard :concatfilter, type: "js", files: %w(vendor/* b a), input_dir: "public/js", output: "public/js/all"
# will concatenate all files in the vendor dir, then b then a (watch out of dependencies)

Advanced usage:

# this is a recommended file structure when using *
# plugins usually need libraries so put libraries like jquery in the libs directory, then your jquery (or another library) plugin(s) in the plugins dir and at the end your main file(s)
guard :concatfilter, type: "js", files: %w(libs/* plugins/* main), input_dir: "public/js", output: "public/js/all"

it's not possible to use * or ./* alone, you have to use * after a directory name, like this: dir/*

Versions changelog

  • 0.0.6 - add :filter & :outputs options
  • 0.0.4 - add star (*) support to load multiple files
  • 0.0.3 - basic version

About

This little guard allows you to concatenate js/css (or other) files in one.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 99.6%
  • JavaScript 0.4%