https://github.com/makevoid/guard-concat
This little guard plugin allows you to concatenate js/css (or other) files in one.
https://github.com/makevoid/guard-concat
Last synced: 10 months ago
JSON representation
This little guard plugin allows you to concatenate js/css (or other) files in one.
- Host: GitHub
- URL: https://github.com/makevoid/guard-concat
- Owner: makevoid
- License: other
- Created: 2013-01-22T03:17:47.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2015-11-16T01:10:09.000Z (about 10 years ago)
- Last Synced: 2025-03-23T18:37:38.928Z (10 months ago)
- Language: Ruby
- Homepage:
- Size: 189 KB
- Stars: 12
- Watchers: 1
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Guard::Concat
This little guard allows you to concatenate js/css (or other) files in one.
## Install
Make sure you have [guard](http://github.com/guard/guard) installed.
Install the gem with:
gem install guard-concat
Or add it to your Gemfile:
gem 'guard-concat'
And then add a basic setup to your Guardfile:
guard init concat
## Usage
``` ruby
# This will concatenate the javascript files a.js and b.js in public/js to all.js
guard :concat, type: "js", files: %w(b a), input_dir: "public/js", output: "public/js/all"
# analog css example
guard :concat, type: "css", files: %w(c d), input_dir: "public/css", output: "public/css/all"
# js example with *
guard :concat, 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:
``` ruby
# 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 :concat, 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.8.1 - fix guard runtime dependency correctly (with ~>)
- 0.8.0 - add debug messages, add support for newer guard, add all_on_start option [yanked from rubygems in favour of 0.8.1]
- 0.0.4 - add star (*) support to load multiple files
- 0.0.3 - basic version
## Contributors
- [@ezekg](https://github.com/ezekg)
- [@mikz](https://github.com/mikz)