Code Monkey home page Code Monkey logo

browser-sync-rails's Introduction

Browser Sync Rails

This gem is a easier way to use browser sync with your rails app.

Getting started

You can add it to your Gemfile with:

group :development do
  gem 'browser_sync_rails'
end

Then run the bundle command to install it.

After you install the gem, you need to run the generator:

bundle exec rails generate browser_sync_rails:install

This generator will prepare your environment for browser sync.

Using

You will use the browser sync along with your rails app. So you need to start the rails app normally and, in another terminal instance, start the browser sync.

The browser sync will proxy your running app and will handle the live reloading and synchronization between multiple devices.

Run this rake task to start it:

bundle exec rake browser_sync:start

Configurations

By default this gem watch for app/assets and app/views. You can also add more files to watch or change the host or port.

It is done in config/browser_sync.yml. Check a config file sample:

# default is: localhost
host: 'some host'

# default is: 3000
port: 1234

# either watch this files along with `app/assets` and `app/views`
files:
  - 'some/file/**/*.css'

Problems?

If something goes wrong with your setup, because of a NPM permission, you'll need to install browser-sync by yourself:

sudo npm install -g browser-sync

Any others, please create a issue about.

Contributing

Feel free to open a Pull Request or open issues. ๐Ÿ˜„

browser-sync-rails's People

Contributors

brunoskonrad avatar

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.