sblogzuloo.blogg.se

Grunt connect livereload example
Grunt connect livereload example











grunt connect livereload example
  1. #GRUNT CONNECT LIVERELOAD EXAMPLE HOW TO#
  2. #GRUNT CONNECT LIVERELOAD EXAMPLE INSTALL#
  3. #GRUNT CONNECT LIVERELOAD EXAMPLE UPDATE#

As seen in the following example installing the JSHint task module: npm install grunt-contrib-jshint -save-devĬheckout the current available gruntplugins to be installed and used on your project at the plugins page.īe sure to commit the updated package.json file with your project when you're done! The Gruntfile The same can be done for gruntplugins and other node modules. Not only will this install locally, but it will automatically be added to the devDependencies section, using a tilde version range.įor example, this will install the latest version of Grunt in your project folder, adding it to your devDependencies: npm install grunt -save-dev The easiest way to add Grunt and gruntplugins to an existing package.json is with the command npm install -save-dev.

  • Start with the example below, and expand as needed, following this specification.
  • The npm init command will create a basic package.json file.
  • Most grunt-init templates will automatically create a project-specific package.json file.
  • There are a few ways to create a package.json file for your project: Running npm install in the same folder as a package.json file will install the correct version of each dependency listed therein. The package.json file belongs in the root directory of your project, next to the Gruntfile, and should be committed with your project source. When this documentation mentions a Gruntfile it is talking about a file, which is either a Gruntfile.js or a ffee. Gruntfile: This file is named Gruntfile.js or ffee and is used to configure or define tasks and load Grunt plugins. You will list grunt and the Grunt plugins your project needs as devDependencies in this file. Package.json: This file is used by npm to store metadata for projects published as npm modules. Preparing a new Grunt projectĪ typical setup will involve adding two files to your project: package.json and the Gruntfile. Installed Grunt tasks can be listed by running grunt -help but it's usually a good idea to start with the project's documentation.
  • Install project dependencies with npm install.
  • grunt connect livereload example

    Change to the project's root directory.Working with an existing Grunt projectĪssuming that the Grunt CLI has been installed and that the project has already been configured with a package.json and a Gruntfile, it's very easy to start working with Grunt: To really understand what is happening, read the code. If a locally installed Grunt is found, the CLI loads the local installation of the Grunt library, applies the configuration from your Gruntfile, and executes any tasks you've requested for it to run. Because of this, you can run grunt from any subfolder in your project. How the CLI worksĮach time grunt is run, it looks for a locally installed Grunt using node's require() system. This allows multiple versions of Grunt to be installed on the same machine simultaneously. Note that installing grunt-cli does not install the Grunt task runner! The job of the Grunt CLI is simple: run the version of Grunt which has been installed next to a Gruntfile. This will put the grunt command in your system path, allowing it to be run from any directory. You may need to use sudo (for OSX, *nix, BSD etc) or run your command shell as Administrator (for Windows) to do this.

    grunt connect livereload example

    In order to get started, you'll want to install Grunt's command line interface (CLI) globally. Using Grunt 0.3? Please see Grunt 0.3 Notes

    #GRUNT CONNECT LIVERELOAD EXAMPLE HOW TO#

    If you already have installed Grunt and are now searching for some quick reference, please checkout our Gruntfile example and how to configure a task.

    #GRUNT CONNECT LIVERELOAD EXAMPLE UPDATE#

    Grunt 0.4.x requires stable Node.js versions >= 0.8.0.īefore setting up Grunt ensure that your npm is up-to-date by running npm update -g npm (this might require sudo on certain systems). Grunt and Grunt plugins are installed and managed via npm, the Node.js package manager.













    Grunt connect livereload example