logo

searx

My custom branche(s) on searx, a meta-search engine git clone https://hacktivis.me/git/searx.git

gruntfile.js (5057B)


  1. module.exports = function(grunt) {
  2. const path = require('path');
  3. grunt.initConfig({
  4. pkg: grunt.file.readJSON('package.json'),
  5. watch: {
  6. scripts: {
  7. files: ['<%= jshint.files %>', 'less/*.less'],
  8. tasks: ['jshint', 'concat', 'uglify', 'webfont', 'less:development', 'less:production']
  9. }
  10. },
  11. concat: {
  12. options: {
  13. separator: ';'
  14. },
  15. dist: {
  16. src: ['js/searx_src/*.js'],
  17. dest: 'js/searx.js'
  18. }
  19. },
  20. uglify: {
  21. options: {
  22. banner: '/*! simple/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n',
  23. output: {
  24. comments: 'some'
  25. },
  26. ie8: false,
  27. warnings: true,
  28. compress: false,
  29. mangle: true,
  30. sourceMap: true
  31. },
  32. dist: {
  33. files: {
  34. 'js/searx.min.js': ['<%= concat.dist.dest %>']
  35. }
  36. }
  37. },
  38. jshint: {
  39. files: ['js/searx_src/*.js'],
  40. options: {
  41. reporterOutput: "",
  42. proto: true,
  43. // options here to override JSHint defaults
  44. globals: {
  45. browser: true,
  46. jQuery: false,
  47. devel: true
  48. }
  49. }
  50. },
  51. less: {
  52. development: {
  53. options: {
  54. paths: ["less"],
  55. banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
  56. },
  57. files: {
  58. "css/searx.css": "less/style.less",
  59. "css/searx-rtl.css": "less/style-rtl.less"
  60. }
  61. },
  62. production: {
  63. options: {
  64. paths: ["less"],
  65. plugins: [
  66. new (require('less-plugin-clean-css'))({
  67. advanced: true,
  68. compatibility: '*'
  69. })
  70. ],
  71. banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
  72. },
  73. files: {
  74. "css/searx.min.css": "less/style.less",
  75. "css/searx-rtl.min.css": "less/style-rtl.less"
  76. }
  77. },
  78. },
  79. webfont: {
  80. icons: {
  81. // src: 'node_modules/ionicons-npm/src/*.svg',
  82. src: [
  83. 'node_modules/ionicons-npm/src/navicon-round.svg',
  84. 'node_modules/ionicons-npm/src/search.svg',
  85. 'node_modules/ionicons-npm/src/play.svg',
  86. 'node_modules/ionicons-npm/src/link.svg',
  87. 'node_modules/ionicons-npm/src/chevron-up.svg',
  88. 'node_modules/ionicons-npm/src/chevron-left.svg',
  89. 'node_modules/ionicons-npm/src/chevron-right.svg',
  90. 'node_modules/ionicons-npm/src/arrow-down-a.svg',
  91. 'node_modules/ionicons-npm/src/arrow-up-a.svg',
  92. 'node_modules/ionicons-npm/src/arrow-swap.svg',
  93. 'node_modules/ionicons-npm/src/telephone.svg',
  94. 'node_modules/ionicons-npm/src/android-arrow-dropdown.svg',
  95. 'node_modules/ionicons-npm/src/android-globe.svg',
  96. 'node_modules/ionicons-npm/src/android-time.svg',
  97. 'node_modules/ionicons-npm/src/location.svg',
  98. 'node_modules/ionicons-npm/src/alert-circled.svg',
  99. 'node_modules/ionicons-npm/src/android-alert.svg',
  100. 'node_modules/ionicons-npm/src/ios-film-outline.svg',
  101. 'node_modules/ionicons-npm/src/music-note.svg',
  102. 'node_modules/ionicons-npm/src/ion-close-round.svg',
  103. 'node_modules/ionicons-npm/src/android-more-vertical.svg',
  104. 'magnet.svg',
  105. 'node_modules/ionicons-npm/src/android-close.svg',
  106. ],
  107. dest: 'fonts',
  108. destLess: 'less',
  109. options: {
  110. font: 'ion',
  111. hashes : true,
  112. syntax: 'bem',
  113. styles : 'font,icon',
  114. types : 'eot,woff2,woff,ttf,svg',
  115. order : 'eot,woff2,woff,ttf,svg',
  116. stylesheets : ['css', 'less'],
  117. relativeFontPath : '../fonts/',
  118. autoHint : false,
  119. normalize : false,
  120. // ligatures : true,
  121. optimize : true,
  122. // fontHeight : 400,
  123. rename : function(name) {
  124. basename = path.basename(name);
  125. if (basename === 'android-alert.svg') {
  126. return 'error.svg';
  127. }
  128. if (basename === 'alert-circled.svg') {
  129. return 'warning.svg';
  130. }
  131. if (basename === 'ion-close-round.svg') {
  132. return 'close.svg';
  133. }
  134. return basename.replace(/(ios|md|android)-/i, '');
  135. },
  136. templateOptions: {
  137. baseClass: 'ion-icon',
  138. classPrefix: 'ion-'
  139. }
  140. }
  141. }
  142. }
  143. });
  144. grunt.loadNpmTasks('grunt-contrib-watch');
  145. grunt.loadNpmTasks('grunt-contrib-uglify');
  146. grunt.loadNpmTasks('grunt-contrib-jshint');
  147. grunt.loadNpmTasks('grunt-contrib-concat');
  148. grunt.loadNpmTasks('grunt-contrib-less');
  149. grunt.loadNpmTasks('grunt-contrib-cssmin');
  150. grunt.loadNpmTasks('grunt-webfont');
  151. grunt.registerTask('test', ['jshint']);
  152. grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'less:development', 'less:production']);
  153. };