npm install -g grunt-cli
Grunt-CLI allows you to run Grunt commmand in your command line
npm install grunt --save-dev
Grunt is installed locally instead of globally (like Grunt-CLI)
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json')
});
};
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
options: {
// options here to override JSHint defaults
globals: {
document: true
}
}
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint']
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('test', ['jshint']);
grunt.registerTask('default', ['jshint']);
};
npm install grunt-contrib-watch --save-dev