grunt-contrib-watch/Gruntfile.js

57 lines
1.3 KiB
JavaScript
Raw Permalink Normal View History

2012-10-17 06:25:07 +08:00
/*
* grunt-contrib-watch
* http://gruntjs.com/
*
2018-04-21 06:23:12 +08:00
* Copyright (c) 2018 "Cowboy" Ben Alman, contributors
2012-10-17 06:25:07 +08:00
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'tasks/**/*.js',
2016-06-06 14:25:10 +08:00
'<%= nodeunit.tests %>'
2012-10-17 06:25:07 +08:00
],
options: {
2016-06-06 14:25:10 +08:00
jshintrc: '.jshintrc'
}
2012-10-17 06:25:07 +08:00
},
2014-11-04 09:38:53 +08:00
jscs: {
src: ['tasks/**/*.js', 'test/tasks/**/*.js'],
options: {
config: '.jscsrc'
}
},
2012-10-17 06:25:07 +08:00
watch: {
all: {
files: ['<%= jshint.all %>'],
2016-06-06 14:25:10 +08:00
tasks: ['jshint', 'nodeunit']
}
2012-10-17 06:25:07 +08:00
},
nodeunit: {
2016-06-06 14:25:10 +08:00
tests: ['test/tasks/*_test.js']
}
});
2012-10-17 06:25:07 +08:00
// Dynamic alias task to nodeunit. Run individual tests with: grunt test:events
grunt.registerTask('test', function(file) {
grunt.task.run('jshint');
2014-11-04 09:38:53 +08:00
grunt.task.run('jscs');
grunt.config('nodeunit.tests', String(grunt.config('nodeunit.tests')).replace('*', file || '*'));
grunt.task.run('nodeunit');
2012-10-17 06:25:07 +08:00
});
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-internal');
2014-11-04 09:38:53 +08:00
grunt.loadNpmTasks('grunt-jscs');
2012-10-17 06:25:07 +08:00
grunt.registerTask('default', ['test', 'build-contrib']);
2012-10-17 06:25:07 +08:00
};