From 2991e7d1fe24ecd04b0ab8ecc128f287eca91c19 Mon Sep 17 00:00:00 2001 From: john19696 <57751845+john19696@users.noreply.github.com> Date: Mon, 31 Jan 2022 10:31:19 +0000 Subject: [PATCH 1/2] Update Gruntfile.js add nodeFlags --- Gruntfile.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 1a11546a..5e043f60 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -6,6 +6,8 @@ const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPl const glob = require("glob"); const path = require("path"); +const nodeFlags = "--experimental-modules --experimental-json-modules --experimental-specifier-resolution=node --no-warnings --no-deprecation"; + /** * Grunt configuration for building the app in various formats. * @@ -356,8 +358,8 @@ module.exports = function (grunt) { command: chainCommands([ "echo '\n--- Regenerating config files. ---'", "echo [] > src/core/config/OperationConfig.json", - "node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation src/core/config/scripts/generateOpsIndex.mjs", - "node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation src/core/config/scripts/generateConfig.mjs", + "node ${nodeFlags} src/core/config/scripts/generateOpsIndex.mjs", + "node ${nodeFlags} src/core/config/scripts/generateConfig.mjs", "echo '--- Config scripts finished. ---\n'" ]), sync: true @@ -365,7 +367,7 @@ module.exports = function (grunt) { generateNodeIndex: { command: chainCommands([ "echo '\n--- Regenerating node index ---'", - "node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation src/node/config/scripts/generateNodeIndex.mjs", + "node ${nodeFlags} src/node/config/scripts/generateNodeIndex.mjs", "echo '--- Node index generated. ---\n'" ]), sync: true @@ -393,21 +395,21 @@ module.exports = function (grunt) { testCJSNodeConsumer: { command: chainCommands([ `cd ${nodeConsumerTestPath}`, - "node --no-warnings cjs-consumer.js", + "node ${nodeFlags} cjs-consumer.js", ]), stdout: false, }, testESMNodeConsumer: { command: chainCommands([ `cd ${nodeConsumerTestPath}`, - "node --no-warnings --experimental-modules --experimental-json-modules esm-consumer.mjs", + "node ${nodeFlags} esm-consumer.mjs", ]), stdout: false, }, testESMDeepImportNodeConsumer: { command: chainCommands([ `cd ${nodeConsumerTestPath}`, - "node --no-warnings --experimental-modules --experimental-json-modules esm-deep-import-consumer.mjs", + "node ${nodeFlags} esm-deep-import-consumer.mjs", ]), stdout: false, }, From 2dbd6478684e4c10b99f6a71dd5f2ee553d7c644 Mon Sep 17 00:00:00 2001 From: John L Date: Mon, 31 Jan 2022 11:39:17 +0000 Subject: [PATCH 2/2] nodeFlags needs quote change --- .nvmrc | 2 +- Gruntfile.js | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.nvmrc b/.nvmrc index 03128968..53d838af 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -lts/dubnium +lts/gallium diff --git a/Gruntfile.js b/Gruntfile.js index 5e043f60..c0e46405 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -351,15 +351,15 @@ module.exports = function (grunt) { command: "git gc --prune=now --aggressive" }, sitemap: { - command: "node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation src/web/static/sitemap.mjs > build/prod/sitemap.xml", + command: `node ${nodeFlags} src/web/static/sitemap.mjs > build/prod/sitemap.xml`, sync: true }, generateConfig: { command: chainCommands([ "echo '\n--- Regenerating config files. ---'", "echo [] > src/core/config/OperationConfig.json", - "node ${nodeFlags} src/core/config/scripts/generateOpsIndex.mjs", - "node ${nodeFlags} src/core/config/scripts/generateConfig.mjs", + `node ${nodeFlags} src/core/config/scripts/generateOpsIndex.mjs`, + `node ${nodeFlags} src/core/config/scripts/generateConfig.mjs`, "echo '--- Config scripts finished. ---\n'" ]), sync: true @@ -367,7 +367,7 @@ module.exports = function (grunt) { generateNodeIndex: { command: chainCommands([ "echo '\n--- Regenerating node index ---'", - "node ${nodeFlags} src/node/config/scripts/generateNodeIndex.mjs", + `node ${nodeFlags} src/node/config/scripts/generateNodeIndex.mjs`, "echo '--- Node index generated. ---\n'" ]), sync: true @@ -395,21 +395,21 @@ module.exports = function (grunt) { testCJSNodeConsumer: { command: chainCommands([ `cd ${nodeConsumerTestPath}`, - "node ${nodeFlags} cjs-consumer.js", + `node ${nodeFlags} cjs-consumer.js`, ]), stdout: false, }, testESMNodeConsumer: { command: chainCommands([ `cd ${nodeConsumerTestPath}`, - "node ${nodeFlags} esm-consumer.mjs", + `node ${nodeFlags} esm-consumer.mjs`, ]), stdout: false, }, testESMDeepImportNodeConsumer: { command: chainCommands([ `cd ${nodeConsumerTestPath}`, - "node ${nodeFlags} esm-deep-import-consumer.mjs", + `node ${nodeFlags} esm-deep-import-consumer.mjs`, ]), stdout: false, },