Created
February 14, 2012 15:14
-
-
Save jsahlen/1827478 to your computer and use it in GitHub Desktop.
My Guard-based build system for front-end assets – see my blog post at http://monospace.se/posts/guard-build-system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gzip_assets: off | |
javascript_compressor: uglifier | |
javascripts: | |
javascripts/site.min: | |
- javascripts/src/vendor/jquery.js | |
- javascripts/src/lib/*.js | |
- javascripts/src/site.js | |
stylesheets: | |
stylesheets/site.min: | |
- stylesheets/site.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source :rubygems | |
# V8 JavaScript Engine (for Uglifier) | |
gem "therubyracer" | |
# SASS & Compass | |
gem "sass", "~> 3.2.0.alpha" | |
gem "compass" | |
# For concatenation/compression | |
gem "jammit" | |
gem "uglifier" | |
# Guard and plugins | |
gem "guard" | |
gem "guard-sass" | |
gem "guard-jammit" | |
gem "guard-livereload" | |
# Mac-specific stuff | |
if RUBY_PLATFORM =~ /darwin/i | |
gem "rb-fsevent" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guard :sass, | |
:input => "stylesheets/src", | |
:output => "stylesheets", | |
:line_numbers => true, | |
:load_paths => Dir.glob('**/**').find_all { |i| File.directory?(i) } << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets" | |
guard :jammit, | |
:config_path => "assets.yml", | |
:output_folder => "." do | |
watch(%r{(?:stylesheets|javascripts)(/.+)\.(?:css|js)}) { |m| m[0] unless m[1] =~ /\/\./ } | |
end | |
guard :livereload, | |
:apply_js_live => false do | |
watch(%r{(.+)\.(?:html|php)}) { |m| m[0] unless m[1] =~ /^\./ || m[1] =~ /\/\./ } | |
watch(%r{(?:stylesheets|javascripts)(/.+)\.(?:css|js)}) { |m| m[0] unless m[1] =~ /\/\./ } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment