summaryrefslogtreecommitdiff
path: root/searx/static/themes/simple/gruntfile.js
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2021-11-25 10:03:12 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2021-11-28 20:04:10 +0100
commit8c4c4259d4f9a856c8c7773591b40be9aef97bb1 (patch)
tree18682a79523411994cc841b0da2e417e866511d2 /searx/static/themes/simple/gruntfile.js
parent11ba7f294ff1db37822dd5e7ec75cab5b30deccd (diff)
downloadsearxng-8c4c4259d4f9a856c8c7773591b40be9aef97bb1.tar.gz
searxng-8c4c4259d4f9a856c8c7773591b40be9aef97bb1.zip
[mod] gruntfile: do some polish (no functional change)
- remove unused 'path' constant - fix indentation - Put all image tasks at the end, where it is easy to list which image is processed. Suggested -by: @dalf https://github.com/searxng/searxng/pull/541#discussion_r756247157 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/static/themes/simple/gruntfile.js')
-rw-r--r--searx/static/themes/simple/gruntfile.js48
1 files changed, 29 insertions, 19 deletions
diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js
index 006d64417..83989397d 100644
--- a/searx/static/themes/simple/gruntfile.js
+++ b/searx/static/themes/simple/gruntfile.js
@@ -2,8 +2,6 @@
module.exports = function(grunt) {
- const path = require('path');
-
grunt.initConfig({
_brand: '../../../../src/brand',
@@ -13,7 +11,16 @@ module.exports = function(grunt) {
watch: {
scripts: {
files: ['gruntfile.js', 'src/**'],
- tasks: ['eslint', 'copy', 'concat', 'svg2jinja', 'uglify', 'image', 'less:development', 'less:production']
+ tasks: [
+ 'eslint',
+ 'copy',
+ 'concat',
+ 'uglify',
+ 'less:development',
+ 'less:production',
+ 'image',
+ 'svg2jinja'
+ ]
}
},
eslint: {
@@ -78,14 +85,18 @@ module.exports = function(grunt) {
},
files: {
'js/searxng.head.js': ['src/js/head/*.js'],
- 'js/searxng.js': ['src/js/main/*.js', '../__common__/js/*.js', './node_modules/autocomplete-js/dist/autocomplete.js']
+ 'js/searxng.js': [
+ 'src/js/main/*.js',
+ '../__common__/js/*.js',
+ './node_modules/autocomplete-js/dist/autocomplete.js'
+ ]
}
}
},
uglify: {
options: {
output: {
- comments: 'some'
+ comments: 'some'
},
ie8: false,
warnings: true,
@@ -100,16 +111,6 @@ module.exports = function(grunt) {
}
}
},
- image: {
- svg4web: {
- options: {
- svgo: ['--config', 'svg4web.svgo.js']
- },
- files: {
- '<%= _templates %>/__common__/searxng-wordmark.min.svg': '<%= _brand %>/searxng-wordmark.svg'
- }
- }
- },
less: {
development: {
options: {
@@ -137,6 +138,16 @@ module.exports = function(grunt) {
}
},
},
+ image: {
+ svg4web: {
+ options: {
+ svgo: ['--config', 'svg4web.svgo.js']
+ },
+ files: {
+ '<%= _templates %>/__common__/searxng-wordmark.min.svg': '<%= _brand %>/searxng-wordmark.svg'
+ }
+ }
+ },
svg2jinja: {
all: {
src: {
@@ -165,7 +176,6 @@ module.exports = function(grunt) {
},
});
-
grunt.registerMultiTask('svg2jinja', 'Create Jinja2 macro', function() {
const ejs = require('ejs'), svgo = require('svgo');
const icons = {}
@@ -240,10 +250,10 @@ module.exports = function(grunt) {
'stylelint',
'copy',
'concat',
- 'svg2jinja',
'uglify',
- 'image',
'less:development',
- 'less:production'
+ 'less:production',
+ 'image',
+ 'svg2jinja',
]);
};