watch.js 765 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * Run predefined tasks whenever watched file patterns are added, changed or deleted.
  3. *
  4. * ---------------------------------------------------------------
  5. *
  6. * Watch for changes on
  7. * - files in the `assets` folder
  8. * - the `tasks/pipeline.js` file
  9. * and re-run the appropriate tasks.
  10. *
  11. * For usage docs see:
  12. * https://github.com/gruntjs/grunt-contrib-watch
  13. *
  14. */
  15. module.exports = function(grunt) {
  16. grunt.config.set('watch', {
  17. api: {
  18. // API files to watch:
  19. files: ['api/**/*', '!**/node_modules/**']
  20. },
  21. assets: {
  22. // Assets to watch:
  23. files: ['assets/**/*', 'tasks/pipeline.js', '!**/node_modules/**'],
  24. // When assets are changed:
  25. tasks: ['syncAssets' , 'linkAssets']
  26. }
  27. });
  28. grunt.loadNpmTasks('grunt-contrib-watch');
  29. };