2014-07-17 22:57:10 +02:00
|
|
|
module.exports = function(grunt) {
|
|
|
|
// measure the time each task takes
|
|
|
|
require('time-grunt')(grunt);
|
|
|
|
|
|
|
|
// autoload Grunt tasks
|
|
|
|
require('load-grunt-tasks')(grunt);
|
|
|
|
|
|
|
|
// main project config
|
|
|
|
grunt.initConfig({
|
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
|
|
|
uglify: {
|
|
|
|
dist: {
|
|
|
|
files: {
|
2014-07-18 00:13:01 +02:00
|
|
|
'dist/<%= pkg.name %>.min.js': '<%= pkg.name %>.js'
|
2014-07-17 22:57:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
jshint: {
|
|
|
|
options: {
|
|
|
|
jshintrc: true
|
|
|
|
},
|
|
|
|
files: [
|
|
|
|
'Gruntfile.js',
|
2014-07-18 00:13:01 +02:00
|
|
|
'<%= pkg.name %>.js',
|
2014-07-17 23:49:43 +02:00
|
|
|
'test/**/*.js'
|
2014-07-17 22:57:10 +02:00
|
|
|
]
|
2014-07-17 23:49:43 +02:00
|
|
|
},
|
|
|
|
mochaTest: {
|
|
|
|
test: {
|
|
|
|
options: {
|
|
|
|
reporter: 'spec'
|
|
|
|
},
|
|
|
|
src: ['test/**/*.js']
|
|
|
|
}
|
2014-07-17 22:57:10 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// user defined tasks
|
2014-07-17 23:49:43 +02:00
|
|
|
grunt.registerTask('test', ['mochaTest']);
|
|
|
|
grunt.registerTask('default', ['jshint', 'mochaTest', 'uglify']);
|
2014-07-17 22:57:10 +02:00
|
|
|
};
|