Coder Social home page Coder Social logo

Comments (20)

thibaudgg avatar thibaudgg commented on August 15, 2024

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.

milushov avatar milushov commented on August 15, 2024

@thibaudgg, but i don't have assets directory, what for i need this line config? 😐

from guard-livereload.

thibaudgg avatar thibaudgg commented on August 15, 2024

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.

milushov avatar milushov commented on August 15, 2024

{ |m| m[1] } doesn't work too

from guard-livereload.

thibaudgg avatar thibaudgg commented on August 15, 2024

What do you get on your browser console?

from guard-livereload.

milushov avatar milushov commented on August 15, 2024

with this line - nothing

from guard-livereload.

thibaudgg avatar thibaudgg commented on August 15, 2024

And you have added (...) in watch( %r{.+/(.+\.css|js)} ) ?

from guard-livereload.

milushov avatar milushov commented on August 15, 2024

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.

thibaudgg avatar thibaudgg commented on August 15, 2024

Do you understand regex?

from guard-livereload.

milushov avatar milushov commented on August 15, 2024

actually yes, but not well

from guard-livereload.

thibaudgg avatar thibaudgg commented on August 15, 2024

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.

milushov avatar milushov commented on August 15, 2024

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.

thibaudgg avatar thibaudgg commented on August 15, 2024

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.

milushov avatar milushov commented on August 15, 2024

console now returns nothing, reloading css file now not work 😞
may be problem with this extension ?

from guard-livereload.

thibaudgg avatar thibaudgg commented on August 15, 2024

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.

milushov avatar milushov commented on August 15, 2024

how i known for linux available only chrome extension

from guard-livereload.

thibaudgg avatar thibaudgg commented on August 15, 2024

I don't understand, sorry.

from guard-livereload.

milushov avatar milushov commented on August 15, 2024

my english or how to solve my issue? 😃

from guard-livereload.

thibaudgg avatar thibaudgg commented on August 15, 2024

both I guess, sorry :)

from guard-livereload.

milushov avatar milushov commented on August 15, 2024

ok 😃

from guard-livereload.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.