Grunt
Grunt is a JavaScript task runner, a tool used to automatically perform frequent tasks such as minification, compilation, unit testing, and linting.
Last updated
Was this helpful?
Grunt is a JavaScript task runner, a tool used to automatically perform frequent tasks such as minification, compilation, unit testing, and linting.
Last updated
Was this helpful?
To install grunt first you must have , NodeJS will have npm (node packaged modules) Run the following commands
Install grunt-cli globally by running the following command
npm install -g grunt-cli
Gruntfile.js
file is a valid JavaScript or CoffeeScript file that belongs in the root directory of your project, next to the package.json
file, and should be committed with your project source.
Navigate to the root directory of your project, then run npm install.
Once you have successfully setup now you can use Grunt CLI commands to automate your task
grunt dist
This will automatically copy all the assets from node_modules
to vendors
folder
grunt sass
This will compile all the sass files to dist/css/style.css
grunt watch
This will automatically compile the sass files on changes
grunt
This will run 4 grunt tasks:
Sass file compilation
Jshint check
Watch for the changes in sass files
Your are free to customize the Grunt task to your need by editing the Gruntfile.js
in the root directory.
It will connect web server on