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.

137 lines
2.9 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. }
  71. }
  72. },
  73. /* What Browsers to Prefix */
  74. prefix: {
  75. browsers: [
  76. 'last 2 version',
  77. '> 1%',
  78. 'opera 12.1',
  79. 'safari 6',
  80. 'ie 9',
  81. 'bb 10',
  82. 'android 4'
  83. ]
  84. },
  85. /* File Renames */
  86. rename: {
  87. minJS : { extname : '.min.js' },
  88. minCSS : { extname : '.min.css' },
  89. rtlCSS : { extname : '.rtl.css' },
  90. rtlMinCSS : { extname : '.rtl.min.css' }
  91. },
  92. /* Minified CSS Concat */
  93. minify: {
  94. processImport : false,
  95. restructuring : false,
  96. keepSpecialComments : 1
  97. },
  98. /* Minified JS Settings */
  99. uglify: {
  100. mangle : true,
  101. preserveComments : 'some'
  102. },
  103. /* Minified Concat CSS Settings */
  104. concatMinify: {
  105. processImport : false,
  106. restructuring : false,
  107. keepSpecialComments : false
  108. },
  109. /* Minified Concat JS */
  110. concatUglify: {
  111. mangle : true,
  112. preserveComments : false
  113. }
  114. }
  115. };