gruntfile.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. module.exports = function(grunt) {
  2. grunt.initConfig({
  3. pkg: grunt.file.readJSON('package.json'),
  4. concat: {
  5. options: {
  6. separator: ';'
  7. },
  8. dist: {
  9. src: ['js/searx_src/*.js'],
  10. dest: 'js/searx.js'
  11. }
  12. },
  13. uglify: {
  14. options: {
  15. banner: '/*! oscar/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
  16. },
  17. dist: {
  18. files: {
  19. 'js/searx.min.js': ['<%= concat.dist.dest %>']
  20. }
  21. }
  22. },
  23. jshint: {
  24. files: ['gruntfile.js', 'js/searx_src/*.js'],
  25. options: {
  26. // options here to override JSHint defaults
  27. globals: {
  28. jQuery: true,
  29. console: true,
  30. module: true,
  31. document: true
  32. }
  33. }
  34. },
  35. watch: {
  36. files: ['<%= jshint.files %>'],
  37. tasks: ['jshint']
  38. }
  39. });
  40. grunt.loadNpmTasks('grunt-contrib-uglify');
  41. grunt.loadNpmTasks('grunt-contrib-jshint');
  42. grunt.loadNpmTasks('grunt-contrib-watch');
  43. grunt.loadNpmTasks('grunt-contrib-concat');
  44. grunt.registerTask('test', ['jshint']);
  45. grunt.registerTask('default', ['jshint', 'concat', 'uglify']);
  46. };