Created
May 22, 2013 15:46
-
-
Save robksawyer/5628615 to your computer and use it in GitHub Desktop.
A basic Gruntfile.js to get started with.
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
'use strict'; | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
concat: { | |
options: { | |
separator: ';' | |
}, | |
dist: { | |
src: ['src/**/*.js'], | |
dest: 'dist/<%= pkg.name %>.js' | |
} | |
}, | |
uglify: { | |
options: { | |
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n' | |
}, | |
dist: { | |
files: { | |
'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>'] | |
} | |
} | |
}, | |
qunit: { | |
files: ['test/**/*.html'] | |
}, | |
jshint: { | |
files: ['gruntfile.js', 'src/**/*.js', 'test/**/*.js'], | |
options: { | |
// options here to override JSHint defaults | |
globals: { | |
jQuery: true, | |
console: true, | |
module: true, | |
document: true | |
} | |
} | |
}, | |
watch: { | |
files: ['<%= jshint.files %>'], | |
tasks: ['jshint', 'qunit'] | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-jshint'); | |
grunt.loadNpmTasks('grunt-contrib-qunit'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-contrib-concat'); | |
grunt.registerTask('test', ['jshint', 'qunit']); | |
grunt.registerTask('default', ['jshint', 'qunit', 'concat', 'uglify']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment