Gruntfile.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*global module:false*/
  2. module.exports = function(grunt) {
  3. // Project configuration.
  4. grunt.initConfig({
  5. // Task configuration.
  6. jshint: {
  7. options: {
  8. curly: true,
  9. eqeqeq: true,
  10. immed: true,
  11. latedef: true,
  12. newcap: true,
  13. noarg: true,
  14. sub: true,
  15. undef: true,
  16. unused: true,
  17. boss: true,
  18. eqnull: true,
  19. node: true,
  20. globals: {
  21. jQuery: true,
  22. window: true,
  23. }
  24. },
  25. gruntfile: {
  26. src: 'Gruntfile.js'
  27. },
  28. lib_test: {
  29. src: ['jsfuck.js', 'lib/**/*.js', 'test/**/*.js']
  30. }
  31. },
  32. nodeunit: {
  33. files: ['test/**/*_test.js']
  34. },
  35. watch: {
  36. gruntfile: {
  37. files: '<%= jshint.gruntfile.src %>',
  38. tasks: ['jshint:gruntfile']
  39. },
  40. lib_test: {
  41. files: '<%= jshint.lib_test.src %>',
  42. tasks: ['jshint:lib_test', 'nodeunit']
  43. }
  44. }
  45. });
  46. // These plugins provide necessary tasks.
  47. grunt.loadNpmTasks('grunt-contrib-nodeunit');
  48. grunt.loadNpmTasks('grunt-contrib-jshint');
  49. grunt.loadNpmTasks('grunt-contrib-watch');
  50. // Default task.
  51. grunt.registerTask('default', ['jshint', 'nodeunit']);
  52. };