watch.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /**
  2. * Copyright © Magento, Inc. All rights reserved.
  3. * See COPYING.txt for license details.
  4. */
  5. 'use strict';
  6. var combo = require('./combo'),
  7. themes = require('../tools/files-router').get('themes'),
  8. _ = require('underscore');
  9. var themeOptions = {};
  10. _.each(themes, function(theme, name) {
  11. themeOptions[name] = {
  12. 'options': {
  13. livereload: true
  14. },
  15. 'files': [
  16. '<%= combo.autopath(\''+name+'\', path.pub) %>/**/*.less'
  17. ],
  18. 'tasks': 'less:' + name
  19. };
  20. });
  21. var watchOptions = {
  22. 'setup': {
  23. 'files': '<%= path.less.setup %>/**/*.less',
  24. 'tasks': 'less:setup'
  25. },
  26. 'updater': {
  27. 'options': {
  28. livereload: true
  29. },
  30. 'files': '<%= path.less.updater %>/**/*.less',
  31. 'tasks': 'less:updater'
  32. },
  33. 'reload': {
  34. 'files': '<%= path.pub %>/**/*.css',
  35. 'options': {
  36. livereload: true
  37. }
  38. }
  39. };
  40. module.exports = _.extend(themeOptions, watchOptions);