watch.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * `tasks/config/watch`
  3. *
  4. * ---------------------------------------------------------------
  5. *
  6. * Run predefined tasks whenever certain files are added, changed or deleted.
  7. *
  8. * For more information, see:
  9. * https://sailsjs.com/anatomy/tasks/config/watch.js
  10. *
  11. */
  12. module.exports = function(grunt) {
  13. grunt.config.set('watch', {
  14. assets: {
  15. // Assets to watch:
  16. files: [
  17. 'assets/**/*',
  18. 'tasks/pipeline.js',
  19. '!**/node_modules/**'
  20. ],
  21. // When assets are changed:
  22. tasks: [
  23. 'syncAssets',
  24. 'linkAssets'
  25. ]
  26. }
  27. });
  28. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  29. // This Grunt plugin is part of the default asset pipeline in Sails,
  30. // so it's already been automatically loaded for you at this point.
  31. //
  32. // Of course, you can always remove this Grunt plugin altogether by
  33. // deleting this file. But check this out: you can also use your
  34. // _own_ custom version of this Grunt plugin.
  35. //
  36. // Here's how:
  37. //
  38. // 1. Install it as a local dependency of your Sails app:
  39. // ```
  40. // $ npm install grunt-contrib-watch --save-dev --save-exact
  41. // ```
  42. //
  43. //
  44. // 2. Then uncomment the following code:
  45. //
  46. // ```
  47. // // Load Grunt plugin from the node_modules/ folder.
  48. // grunt.loadNpmTasks('grunt-contrib-watch');
  49. // ```
  50. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  51. };