Ponysearch/searx/static/themes/oscar/gruntfile.js
Markus Heiser 757ebb5d9f [fix] brands: add variables from build env to grunt process
We have some variables in the build environment which are also needed in the
grunt process when building themes.  Theses variables are relavant if one
creates a fork with its own branding.  We treat these variables under the term
'brands'.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-03-25 14:09:47 +01:00

94 lines
2.7 KiB
JavaScript

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") %> | <%= process.env.GIT_URL %> */\n'
},
dist: {
files: {
'js/searx.min.js': ['<%= concat.dist.dest %>']
}
}
},
jshint: {
files: ['gruntfile.js', 'js/searx_src/*.js'],
options: {
reporterOutput: "",
// options here to override JSHint defaults
globals: {
jQuery: true,
console: true,
module: true,
document: true
}
}
},
less: {
development: {
options: {
paths: ["less/pointhi", "less/logicodev", "less/logicodev-dark"]
},
files: {"css/pointhi.css": "less/pointhi/oscar.less",
"css/logicodev.css": "less/logicodev-dark/oscar.less",
"css/logicodev-dark.css": "less/logicodev/oscar.less"}
},
production: {
options: {
paths: ["less/pointhi", "less/logicodev", "less/logicodev-dark"],
cleancss: true
},
files: {"css/pointhi.min.css": "less/pointhi/oscar.less",
"css/logicodev.min.css": "less/logicodev/oscar.less",
"css/logicodev-dark.min.css": "less/logicodev-dark/oscar.less"}
},
/*
// built with ./manage.sh styles
bootstrap: {
options: {
paths: ["less/bootstrap"],
cleancss: true
},
files: {"css/bootstrap.min.css": "less/bootstrap/bootstrap.less"}
},
*/
},
watch: {
scripts: {
files: ['<%= jshint.files %>'],
tasks: ['jshint', 'concat', 'uglify']
},
oscar_styles: {
files: ['less/pointhi/**/*.less'],
tasks: ['less:development', 'less:production']
},
bootstrap_styles: {
files: ['less/bootstrap/**/*.less'],
tasks: ['less:bootstrap']
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.registerTask('test', ['jshint']);
grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'less']);
grunt.registerTask('styles', ['less']);
};