You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
969 B

  1. module.exports = function(grunt) {
  2. 'use strict';
  3. grunt.initConfig({
  4. watch: {
  5. all: {
  6. files: ['lib/*.js'],
  7. },
  8. onlyAdded: {
  9. options: {
  10. event: 'added',
  11. },
  12. files: ['lib/*.js'],
  13. },
  14. onlyChanged: {
  15. options: {
  16. event: 'changed',
  17. },
  18. files: ['lib/*.js'],
  19. },
  20. onlyDeleted: {
  21. options: {
  22. event: 'deleted',
  23. },
  24. files: ['lib/*.js'],
  25. },
  26. onlyAddedAndDeleted: {
  27. options: {
  28. event: ['added', 'deleted'],
  29. },
  30. files: ['lib/*.js'],
  31. }
  32. },
  33. });
  34. // Load this watch task
  35. grunt.loadTasks('../../../tasks');
  36. // trigger on watch events
  37. var timeout;
  38. grunt.event.on('watch', function(action, filepath) {
  39. grunt.log.writeln(filepath + ' was indeed ' + action);
  40. clearTimeout(timeout);
  41. timeout = setTimeout(function() {
  42. grunt.util.exit(0);
  43. }, 2000);
  44. });
  45. };