diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2021-12-01 11:46:44 +0100 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2021-12-01 21:09:26 +0100 |
commit | f54460a80507d5b7c53af98ded327bb5e60a1254 (patch) | |
tree | 294410a11b735380fdfad360be07b8752cdf7fbf /searx | |
parent | ae49b5224c06f03121298fc5ed164c3722b9f62b (diff) | |
download | searxng-f54460a80507d5b7c53af98ded327bb5e60a1254.tar.gz searxng-f54460a80507d5b7c53af98ded327bb5e60a1254.zip |
[fix] simple theme: make JS sources available on non build hosts
Include the source files directly in the `.map` files [1] for two reasons:
1. In the simple theme, modules from `./node_modules` are only available on
developer's build host (a `make node.env` is needed to get the sources). By
example; in the `searxng.min.js.map` file, the `autocomplete.js` is linked at
URL:
../node_modules/autocomplete-js/dist/autocomplete.js
2. Later, when client sources has been moved out of the `./static` URL [2] to
the `<repo-roo>/src` folder, all JS sources are no longer available.
Drawback: `.map` files grow up in size, but this should not bother, because the
files are only loaded in debug mode.
[1] https://github.com/gruntjs/grunt-contrib-uglify#sourcemapincludesources
[2] https://github.com/searxng/searxng/issues/141
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx')
-rw-r--r-- | searx/static/themes/simple/gruntfile.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js index 57682430d..ca59cb562 100644 --- a/searx/static/themes/simple/gruntfile.js +++ b/searx/static/themes/simple/gruntfile.js @@ -88,7 +88,9 @@ module.exports = function(grunt) { warnings: true, compress: false, mangle: true, - sourceMap: true + sourceMap: { + includeSources: true + } }, dist: { files: { |