Created
July 23, 2013 19:49
-
-
Save agamm/6065556 to your computer and use it in GitHub Desktop.
My Basic Grunt Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
uglify: { | |
options: { | |
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + | |
'<%= grunt.template.today("yyyy-mm-dd") %> */' | |
}, | |
my_target: { | |
files: { | |
'dest/complete.min.js': ['scripts/*.js'] | |
} | |
} | |
}, | |
jshint: { | |
files: ['gruntfile.js', 'srcipts/*.js'], | |
options: { | |
// options here to override JSHint defaults | |
globals: { | |
jQuery: true, | |
console: true, | |
module: true, | |
document: true | |
} | |
} | |
}, | |
watch: { | |
options: { | |
livereload: true, | |
}, | |
all: { | |
files: ['index.html','styles/*.css', 'scripts/*.js'], | |
}, | |
}, | |
}); | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-jshint'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.registerTask('default', ['jshint', 'uglify','watch']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And package.json:
{
"name": "name",
"version": "0.0.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-watch": "~0.4.0",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-jshint": "~0.6.0",
"matchdep": "~0.1.2"
}
}