Comments (20)
Don't forget to make match assets path used in your html page, ie:
guard 'livereload' do
watch( %r{.+/(.+\.css|js)} ) { |m| "/assets_path/#{m[1]}" } # EDIT HERE
watch( %r{.+\.html} )
end
from guard-livereload.
@thibaudgg, but i don't have assets directory, what for i need this line config? 😐
from guard-livereload.
Livereload get the "/home/roma/Dropbox/r/divers/javascripts/app.js" path, you need to send only "javascripts/app.js", so you need to edit the { |m| ... }
block. Maybe { |m| m[1] }
should work.
from guard-livereload.
{ |m| m[1] }
doesn't work too
from guard-livereload.
What do you get on your browser console?
from guard-livereload.
with this line - nothing
from guard-livereload.
And you have added (...)
in watch( %r{.+/(.+\.css|js)} )
?
from guard-livereload.
hmm.. i don't understand, i'am trying:
guard 'livereload' do
watch( %r{.+/(.+\.css|js)} ) { |m| m[1] }
watch( %r{.+\.html} )
end
and this don't work for me
from guard-livereload.
Do you understand regex?
from guard-livereload.
actually yes, but not well
from guard-livereload.
With the ( )
do you get something in your browser console?
maybe try:
guard 'livereload' do
watch( %r{(.*\.(css|js))} ) { |m| "/#{m[1]}" }
watch( %r{.+\.html} )
end
so if you edit/touch /home/roma/Dropbox/r/divers/javascripts/app.js
guard-livereload will send /javascripts/app.js
.
You launch guard inside /home/roma/Dropbox/r/divers/
directory, right?
from guard-livereload.
With the ( ) do you get something in your browser console?
you mean double nested( )
in case below? 😳
with this:
guard 'livereload' do
watch( %r{(.*\.(css|js))} ) { |m| "/#{m[1]}" }
watch( %r{.+\.html} )
end
i get in console:
LiveReload: ["refresh",{"path":"/home/roma/Dropbox/r/divers//javascripts/app.js","apply_js_live":true,"apply_css_live":true}]
and css file still reloading ok
You launch guard inside /home/roma/Dropbox/r/divers/ directory, right?
yep
from guard-livereload.
Ok, this should works:
watch( %r{.*/((javascripts|stylesheets)/.*(css|js))} ) { |m| "/#{m[1]}" }
And you should get /javascripts/app.js
path in your brower.
from guard-livereload.
console now returns nothing, reloading css file now not work 😞
may be problem with this extension ?
from guard-livereload.
I don't think so, there's something wrong in your config. Maybe the app from http://livereload.com will be easier to use for you?
from guard-livereload.
how i known for linux available only chrome extension
from guard-livereload.
I don't understand, sorry.
from guard-livereload.
my english or how to solve my issue? 😃
from guard-livereload.
both I guess, sorry :)
from guard-livereload.
ok 😃
from guard-livereload.
Related Issues (20)
- Security Vulnerability - possible to read arbitrary files via socket HOT 2
- CSS refresh then reload HOT 6
- Not reloading CSS correctly with config.assets.debug = false HOT 8
- Error installing guard-livereload
- Where is the package located? HOT 5
- not compatible with ruby-2.3.3 and Rails 5.0.0.1 HOT 1
- Not working with Ruby 2.4.0 and Rails 5.0.1 HOT 2
- guard livereload using ipv4 only . how to force to use ipv6. HOT 1
- Hangs when retrieving livereload.js
- Cannot init or load guard-livereload on Ruby 2.4.1/Windows HOT 4
- Could not find eventmachine-1.2.5 in any of the sources HOT 1
- "no acceptor" rspec error HOT 3
- Error "Could not parse data entirely (0 != 609) (HTTP::Parser::Error)" HOT 4
- Wiki page dead links: Usage::2. Adding a snippet to your web page HOT 2
- undefined method `epoll?' for EventMachine
- there is no add-ons' URL link of FireFox. HOT 1
- No such file or directory -- /usr/lib/ruby/vendor_ruby/guard/_guard-core
- guard-livereload reports with undefined method epoll? error HOT 5
- CSS edits lose styling after reload HOT 3
- Rails 7.0.0 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from guard-livereload.