Gruntfile.js 1008 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. 'use strict';
  2. module.exports = function(grunt) {
  3. // Project configuration.
  4. grunt.initConfig({
  5. nodeunit: {
  6. files: ['test/**/*_test.js'],
  7. },
  8. jshint: {
  9. options: {
  10. jshintrc: '.jshintrc'
  11. },
  12. gruntfile: {
  13. src: 'Gruntfile.js'
  14. },
  15. lib: {
  16. src: ['lib/**/*.js']
  17. },
  18. test: {
  19. src: ['test/**/*.js']
  20. },
  21. },
  22. watch: {
  23. gruntfile: {
  24. files: '<%= jshint.gruntfile.src %>',
  25. tasks: ['jshint:gruntfile']
  26. },
  27. lib: {
  28. files: '<%= jshint.lib.src %>',
  29. tasks: ['jshint:lib', 'nodeunit']
  30. },
  31. test: {
  32. files: '<%= jshint.test.src %>',
  33. tasks: ['jshint:test', 'nodeunit']
  34. },
  35. },
  36. });
  37. // These plugins provide necessary tasks.
  38. grunt.loadNpmTasks('grunt-contrib-nodeunit');
  39. grunt.loadNpmTasks('grunt-contrib-jshint');
  40. grunt.loadNpmTasks('grunt-contrib-watch');
  41. // Default task.
  42. grunt.registerTask('default', ['jshint', 'nodeunit']);
  43. };