Skip to content

Instantly share code, notes, and snippets.

@agamm
Created July 23, 2013 19:49
Show Gist options
  • Save agamm/6065556 to your computer and use it in GitHub Desktop.
Save agamm/6065556 to your computer and use it in GitHub Desktop.
My Basic Grunt Setup
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']);
};
@agamm
Copy link
Author

agamm commented Jul 23, 2013

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"
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment