From the course: Learning CoffeeScript

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Adding a default task and live reloading

Adding a default task and live reloading - CoffeeScript Tutorial

From the course: Learning CoffeeScript

Start my 1-month free trial

Adding a default task and live reloading

Running a single task is just fine but eventually you're going to want things to happen more automatically. So let's go ahead and create a more streamline way to process our tasks and also set up live reloading. Now to do all this we're going to need to add some additional variables up here. So right at the end of the variable declaration I'm going to add some additional things. So, I'll need to add a new live reload variable here, and ask it to require. So we'll need to load the live reload module. And the live reload module also requires that you load in the tiny dash lr module as well. So I'll do require tiny-lr. And then we'll also need to create a server variable, and that is just going to be set to the lr method from this other library. Okay, the next thing I'm going to do is, I'm going to take the sources of my JavaScript document out of here, so I'll take this array and just take it out of there, and then up here, I'm going to just create it as a separate variable, so that's…

Contents