2014-11-30 13:21:58 +01:00
|
|
|
module.exports = function(grunt) {
|
|
|
|
|
|
|
|
grunt.initConfig({
|
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
|
|
|
concat: {
|
|
|
|
options: {
|
|
|
|
separator: ';'
|
|
|
|
},
|
|
|
|
dist: {
|
2021-03-10 15:03:18 +01:00
|
|
|
src: ['src/js/*.js'],
|
2014-11-30 13:21:58 +01:00
|
|
|
dest: 'js/searx.js'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
uglify: {
|
|
|
|
options: {
|
2020-12-01 10:07:01 +01:00
|
|
|
sourceMap: true,
|
2020-03-25 14:09:47 +01:00
|
|
|
banner: '/*! oscar/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n'
|
2014-11-30 13:21:58 +01:00
|
|
|
},
|
|
|
|
dist: {
|
|
|
|
files: {
|
|
|
|
'js/searx.min.js': ['<%= concat.dist.dest %>']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
jshint: {
|
|
|
|
files: ['gruntfile.js', 'js/searx_src/*.js'],
|
|
|
|
options: {
|
2019-12-10 18:10:33 +01:00
|
|
|
reporterOutput: "",
|
2014-11-30 13:21:58 +01:00
|
|
|
// options here to override JSHint defaults
|
|
|
|
globals: {
|
|
|
|
jQuery: true,
|
|
|
|
console: true,
|
|
|
|
module: true,
|
|
|
|
document: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2014-12-22 15:28:23 +01:00
|
|
|
less: {
|
2021-03-10 14:17:07 +01:00
|
|
|
development: {
|
|
|
|
options: {
|
2021-03-10 15:03:18 +01:00
|
|
|
paths: ["src/less/pointhi", "src/less/logicodev", "src/less/logicodev-dark"]
|
2014-12-22 15:28:23 +01:00
|
|
|
},
|
2021-03-10 14:17:07 +01:00
|
|
|
files: {
|
2021-03-10 15:03:18 +01:00
|
|
|
"css/pointhi.css": "src/less/pointhi/oscar.less",
|
|
|
|
"css/logicodev.css": "src/less/logicodev-dark/oscar.less",
|
|
|
|
"css/logicodev-dark.css": "src/less/logicodev/oscar.less"
|
2021-03-10 14:17:07 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
production: {
|
|
|
|
options: {
|
2021-03-10 15:03:18 +01:00
|
|
|
paths: ["src/less/pointhi", "src/less/logicodev", "src/less/logicodev-dark"],
|
2021-03-10 14:17:07 +01:00
|
|
|
plugins: [
|
|
|
|
new (require('less-plugin-clean-css'))()
|
|
|
|
],
|
|
|
|
sourceMap: true,
|
2014-12-22 15:28:23 +01:00
|
|
|
},
|
2021-03-10 14:17:07 +01:00
|
|
|
files: {
|
2021-03-10 15:03:18 +01:00
|
|
|
"css/pointhi.min.css": "src/less/pointhi/oscar.less",
|
|
|
|
"css/logicodev.min.css": "src/less/logicodev/oscar.less",
|
|
|
|
"css/logicodev-dark.min.css": "src/less/logicodev-dark/oscar.less"
|
2021-03-10 14:17:07 +01:00
|
|
|
}
|
|
|
|
},
|
2014-12-22 15:28:23 +01:00
|
|
|
},
|
2014-11-30 13:21:58 +01:00
|
|
|
watch: {
|
2014-12-22 15:28:23 +01:00
|
|
|
scripts: {
|
|
|
|
files: ['<%= jshint.files %>'],
|
|
|
|
tasks: ['jshint', 'concat', 'uglify']
|
|
|
|
},
|
|
|
|
oscar_styles: {
|
2021-03-10 15:03:18 +01:00
|
|
|
files: ['src/less/pointhi/**/*.less'],
|
2014-12-22 15:28:23 +01:00
|
|
|
tasks: ['less:development', 'less:production']
|
|
|
|
},
|
|
|
|
bootstrap_styles: {
|
|
|
|
files: ['less/bootstrap/**/*.less'],
|
|
|
|
tasks: ['less:bootstrap']
|
|
|
|
}
|
2014-11-30 13:21:58 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
2014-12-22 15:28:23 +01:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-less');
|
2014-11-30 13:21:58 +01:00
|
|
|
|
|
|
|
grunt.registerTask('test', ['jshint']);
|
|
|
|
|
2014-12-22 15:28:23 +01:00
|
|
|
grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'less']);
|
2019-12-10 18:10:33 +01:00
|
|
|
|
2014-12-22 15:28:23 +01:00
|
|
|
grunt.registerTask('styles', ['less']);
|
2014-11-30 13:21:58 +01:00
|
|
|
|
|
|
|
};
|