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.

141 lines
3.0 KiB

9 years ago
  1. var
  2. console = require('better-console'),
  3. config = require('../user'),
  4. release = require('./release')
  5. ;
  6. module.exports = {
  7. banner : release.banner,
  8. log: {
  9. created: function(file) {
  10. return 'Created: ' + file;
  11. },
  12. modified: function(file) {
  13. return 'Modified: ' + file;
  14. }
  15. },
  16. filenames: {
  17. concatenatedCSS : 'semantic.css',
  18. concatenatedJS : 'semantic.js',
  19. concatenatedMinifiedCSS : 'semantic.min.css',
  20. concatenatedMinifiedJS : 'semantic.min.js',
  21. concatenatedRTLCSS : 'semantic.rtl.css',
  22. concatenatedMinifiedRTLCSS : 'semantic.rtl.min.css'
  23. },
  24. regExp: {
  25. comments: {
  26. // remove all comments from config files (.variable)
  27. variables : {
  28. in : /(\/\*[\s\S]+?\*\/+)[\s\S]+?\/\* End Config \*\//,
  29. out : '$1',
  30. },
  31. // add version to first comment
  32. license: {
  33. in : /(^\/\*[\s\S]+)(# Semantic UI )([\s\S]+?\*\/)/,
  34. out : '$1$2' + release.version + ' $3'
  35. },
  36. // adds uniform spacing around comments
  37. large: {
  38. in : /(\/\*\*\*\*[\s\S]+?\*\/)/mg,
  39. out : '\n\n$1\n'
  40. },
  41. small: {
  42. in : /(\/\*---[\s\S]+?\*\/)/mg,
  43. out : '\n$1\n'
  44. },
  45. tiny: {
  46. in : /(\/\* [\s\S]+? \*\/)/mg,
  47. out : '\n$1'
  48. }
  49. },
  50. theme: /.*\/themes\/.*?(?=\/)/mg
  51. },
  52. settings: {
  53. /* Remove Files in Clean */
  54. del: {
  55. silent : true
  56. },
  57. /* Comment Banners */
  58. header: {
  59. title : release.title,
  60. version : release.version,
  61. repository : release.repository,
  62. url : release.url
  63. },
  64. plumber: {
  65. less: {
  66. errorHandler: function(error) {
  67. if(error.filename.match(/theme.less/)) {
  68. console.error('Looks like your theme.config is out of date. You will need to add new elements from theme.config.example');
  69. }
  70. else {
  71. console.log(error);
  72. this.emit('end');
  73. }
  74. }
  75. }
  76. },
  77. /* What Browsers to Prefix */
  78. prefix: {
  79. browsers: [
  80. 'last 2 version',
  81. '> 1%',
  82. 'opera 12.1',
  83. 'safari 6',
  84. 'ie 9',
  85. 'bb 10',
  86. 'android 4'
  87. ]
  88. },
  89. /* File Renames */
  90. rename: {
  91. minJS : { extname : '.min.js' },
  92. minCSS : { extname : '.min.css' },
  93. rtlCSS : { extname : '.rtl.css' },
  94. rtlMinCSS : { extname : '.rtl.min.css' }
  95. },
  96. /* Minified CSS Concat */
  97. minify: {
  98. processImport : false,
  99. restructuring : false,
  100. keepSpecialComments : 1
  101. },
  102. /* Minified JS Settings */
  103. uglify: {
  104. mangle : true,
  105. preserveComments : 'some'
  106. },
  107. /* Minified Concat CSS Settings */
  108. concatMinify: {
  109. processImport : false,
  110. restructuring : false,
  111. keepSpecialComments : false
  112. },
  113. /* Minified Concat JS */
  114. concatUglify: {
  115. mangle : true,
  116. preserveComments : false
  117. }
  118. }
  119. };