clean.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /**
  2. * Copyright © Magento, Inc. All rights reserved.
  3. * See COPYING.txt for license details.
  4. */
  5. 'use strict';
  6. var themes = require('../tools/files-router').get('themes'),
  7. _ = require('underscore');
  8. var themeOptions = {};
  9. _.each(themes, function(theme, name) {
  10. themeOptions[name] = {
  11. "force": true,
  12. "files": [
  13. {
  14. "force": true,
  15. "dot": true,
  16. "src": [
  17. "<%= path.tmp %>/cache/**/*",
  18. "<%= combo.autopath(\""+name+"\", path.pub ) %>**/*",
  19. "<%= combo.autopath(\""+name+"\", path.tmpLess) %>**/*",
  20. "<%= combo.autopath(\""+name+"\", path.tmpSource) %>**/*",
  21. "<%= path.deployedVersion %>"
  22. ]
  23. }
  24. ]
  25. };
  26. });
  27. var cleanOptions = {
  28. "var": {
  29. "force": true,
  30. "files": [
  31. {
  32. "force": true,
  33. "dot": true,
  34. "src": [
  35. "<%= path.tmp %>/cache/**/*",
  36. "<%= path.tmp %>/generation/**/*",
  37. "<%= path.tmp %>/log/**/*",
  38. "<%= path.tmp %>/maps/**/*",
  39. "<%= path.tmp %>/page_cache/**/*",
  40. "<%= path.tmp %>/tmp/**/*",
  41. "<%= path.tmp %>/view/**/*",
  42. "<%= path.tmp %>/view_preprocessed/**/*"
  43. ]
  44. }
  45. ]
  46. },
  47. "pub": {
  48. "force": true,
  49. "files": [
  50. {
  51. "force": true,
  52. "dot": true,
  53. "src": [
  54. "<%= path.pub %>frontend/**/*",
  55. "<%= path.pub %>adminhtml/**/*",
  56. "<%= path.deployedVersion %>"
  57. ]
  58. }
  59. ]
  60. },
  61. "styles": {
  62. "force": true,
  63. "files": [
  64. {
  65. "force": true,
  66. "dot": true,
  67. "src": [
  68. "<%= path.tmp %>/view_preprocessed/**/*",
  69. "<%= path.tmp %>/cache/**/*",
  70. "<%= path.pub %>frontend/**/*.less",
  71. "<%= path.pub %>frontend/**/*.css",
  72. "<%= path.pub %>adminhtml/**/*.less",
  73. "<%= path.pub %>adminhtml/**/*.css",
  74. "<%= path.deployedVersion %>"
  75. ]
  76. }
  77. ]
  78. },
  79. "markup": {
  80. "force": true,
  81. "files": [
  82. {
  83. "force": true,
  84. "dot": true,
  85. "src": [
  86. "<%= path.tmp %>/cache/**/*",
  87. "<%= path.tmp %>/generation/**/*",
  88. "<%= path.tmp %>/view_preprocessed/html/**/*",
  89. "<%= path.tmp %>/page_cache/**/*"
  90. ]
  91. }
  92. ]
  93. },
  94. "js": {
  95. "force": true,
  96. "files": [
  97. {
  98. "force": true,
  99. "dot": true,
  100. "src": [
  101. "<%= path.pub %>**/*.js",
  102. "<%= path.pub %>**/*.html",
  103. "<%= path.pub %>_requirejs/**/*",
  104. "<%= path.deployedVersion %>"
  105. ]
  106. }
  107. ]
  108. }
  109. };
  110. module.exports = _.extend(cleanOptions, themeOptions);