Picture of Sam Tsiu
Re: Livereload
by Sam Tsiu - Thursday, 9 March 2017, 4:25 AM
 

You should definitely try rub. It's a great tool  to work directly with the framework.

If you insist on working with grunt, here's a simple solution.

1. install browser-sync globally with npm install -g browser-sync

2. develop and watch your course with grunt dev 

3. in another terminal window, instead of  grunt server , run browser-sync start -s build -f build

-s build (serve files from the build directory)

-f build (watch build directory for changes to fire reload, you can narrow down this to build/course if you only work with course, not plugins)

There are a lot other options you can explore, run browser-sync help start to find out.

Cheers

Sam

 

 

Picture of Scott L
Re: Livereload
by Scott L - Saturday, 22 April 2017, 1:54 AM
 

Sam, your browser-sync workflow is just what I was wondering about. Thanks so much for posting this!

I added an npm script to the bottom of package.json for a (not much) shorter run command:

,
"scripts": {
  "bserver": "browser-sync start -s build -f build"
}

To run: $ npm run bserver

Picture of Sam Tsiu
Re: Livereload
by Sam Tsiu - Saturday, 22 April 2017, 3:28 AM
 

That's even better! Thanks, Scott!

As mentioned above, I use rub in my workflow. It's a great tool!