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