Browse Source

Fixed sitemap generation

n1474335 5 years ago
parent
commit
2a91af152d
2 changed files with 4 additions and 6 deletions
  1. 2 4
      Gruntfile.js
  2. 2 2
      src/web/static/sitemap.mjs

+ 2 - 4
Gruntfile.js

@@ -140,8 +140,7 @@ module.exports = function (grunt) {
                     mode: "production",
                     mode: "production",
                     target: "web",
                     target: "web",
                     entry: Object.assign({
                     entry: Object.assign({
-                        main: "./src/web/index.js",
-                        sitemap: "./src/web/static/sitemap.js"
+                        main: "./src/web/index.js"
                     }, moduleEntryPoints),
                     }, moduleEntryPoints),
                     output: {
                     output: {
                         path: __dirname + "/build/prod",
                         path: __dirname + "/build/prod",
@@ -232,7 +231,6 @@ module.exports = function (grunt) {
                     "build/prod/**/*",
                     "build/prod/**/*",
                     "!build/prod/index.html",
                     "!build/prod/index.html",
                     "!build/prod/BundleAnalyzerReport.html",
                     "!build/prod/BundleAnalyzerReport.html",
-                    "!build/prod/sitemap.js"
                 ],
                 ],
                 dest: `build/prod/CyberChef_v${pkg.version}.zip`
                 dest: `build/prod/CyberChef_v${pkg.version}.zip`
             }
             }
@@ -328,7 +326,7 @@ module.exports = function (grunt) {
                 command: "git gc --prune=now --aggressive"
                 command: "git gc --prune=now --aggressive"
             },
             },
             sitemap: {
             sitemap: {
-                command: "node build/prod/sitemap.js > build/prod/sitemap.xml"
+                command: "node --experimental-modules --no-warnings --no-deprecation src/web/static/sitemap.mjs > build/prod/sitemap.xml"
             },
             },
             generateConfig: {
             generateConfig: {
                 command: [
                 command: [

+ 2 - 2
src/web/static/sitemap.js → src/web/static/sitemap.mjs

@@ -1,4 +1,4 @@
-import sm from "sitemap";
+import Sitemap from "sitemap";
 import OperationConfig from "../../core/config/OperationConfig.json";
 import OperationConfig from "../../core/config/OperationConfig.json";
 
 
 
 
@@ -10,7 +10,7 @@ import OperationConfig from "../../core/config/OperationConfig.json";
  * @license Apache-2.0
  * @license Apache-2.0
  */
  */
 
 
-const sitemap = sm.createSitemap({
+const sitemap = Sitemap.createSitemap({
     hostname: "https://gchq.github.io/CyberChef",
     hostname: "https://gchq.github.io/CyberChef",
 });
 });