Book Image

LESS WEB DEVELOPMENT COOKBOOK

Book Image

LESS WEB DEVELOPMENT COOKBOOK

Overview of this book

Table of Contents (19 chapters)
Less Web Development Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding the connect and open task


The next tasks that you are going to add are the connect and open tasks. The connect plugin provides a simple static development server that you can use to serve your static files. You can use the livereload option provided by the connect plugin along with the watch task (see the Adding the watch task recipe) to automatically reload your browser as you work on your project. In addition to the connect task, you will also add a small task using the open plugin to open a URL that is unsurprisingly called the open task.

This recipe will show you how to set the connect task along with the open task to automatically open served folders as you work on your project.

Getting ready

The only requirement for this recipe is to have the open and the connect plugins installed and loaded in your Gruntfile.js file. If you haven't installed these plugins in the Installing Grunt plugins recipe of this chapter, you can do this now using the following command in the root of your...