Created
March 22, 2014 17:47
-
-
Save julik/9711389 to your computer and use it in GitHub Desktop.
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
# Rig up livereload for frontend stuff | |
guard 'livereload', apply_js_live: false, apply_css_live: true do | |
# Do full reloads for everything except CSS | |
watch(%r{.+\.(js|coffee|erb)$}) | |
# Do full reloads when we modify the bom.json file with | |
# our Javascripts listed in loading order | |
watch(%r{.+\/bom\.json$}) | |
# Using live compilation has it's downsides. | |
# | |
# LiveReload in rack-livereload will only do CSS injection | |
# if the "path" parameter passed to it has the ".css" raw extension. | |
# Therefore we have to hint LiveReload that once a .scss is modified | |
# he has to notify of changes on the related ".css" file. | |
watch(%r{.+\.(s?css)$}) do | m | | |
m[0].gsub(/\.scss$/, '.css') # Make the browser reload with the CSS URL instead | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment