summaryrefslogtreecommitdiff
path: root/searx/static/oscar/gruntfile.js
diff options
context:
space:
mode:
authorThomas Pointhuber <thomas.pointhuber@gmx.at>2014-11-30 13:21:58 +0100
committerThomas Pointhuber <thomas.pointhuber@gmx.at>2014-11-30 13:21:58 +0100
commite687f5c290d30d32c9c32c4ae5c7b9085697ab87 (patch)
treede05f90b950859e1d5136b301de9ac877d467c4f /searx/static/oscar/gruntfile.js
parent08f4b7f5062ad75299797c71ec23eaa4e7bf706f (diff)
[enh][oscar_template] split js-files and compile them together
Diffstat (limited to 'searx/static/oscar/gruntfile.js')
-rw-r--r--searx/static/oscar/gruntfile.js51
1 files changed, 51 insertions, 0 deletions
diff --git a/searx/static/oscar/gruntfile.js b/searx/static/oscar/gruntfile.js
new file mode 100644
index 000000000..79da491c4
--- /dev/null
+++ b/searx/static/oscar/gruntfile.js
@@ -0,0 +1,51 @@
+module.exports = function(grunt) {
+
+ grunt.initConfig({
+ pkg: grunt.file.readJSON('package.json'),
+ concat: {
+ options: {
+ separator: ';'
+ },
+ dist: {
+ src: ['js/searx_src/*.js'],
+ dest: 'js/searx.js'
+ }
+ },
+ uglify: {
+ options: {
+ banner: '/*! oscar/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
+ },
+ dist: {
+ files: {
+ 'js/searx.min.js': ['<%= concat.dist.dest %>']
+ }
+ }
+ },
+ jshint: {
+ files: ['gruntfile.js', 'js/searx_src/*.js'],
+ options: {
+ // options here to override JSHint defaults
+ globals: {
+ jQuery: true,
+ console: true,
+ module: true,
+ document: true
+ }
+ }
+ },
+ watch: {
+ files: ['<%= jshint.files %>'],
+ tasks: ['jshint']
+ }
+ });
+
+ grunt.loadNpmTasks('grunt-contrib-uglify');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-watch');
+ grunt.loadNpmTasks('grunt-contrib-concat');
+
+ grunt.registerTask('test', ['jshint']);
+
+ grunt.registerTask('default', ['jshint', 'concat', 'uglify']);
+
+};