Explorar o código

Update Gruntfile.js

add nodeFlags
john19696 %!s(int64=3) %!d(string=hai) anos
pai
achega
2991e7d1fe
Modificáronse 1 ficheiros con 8 adicións e 6 borrados
  1. 8 6
      Gruntfile.js

+ 8 - 6
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,
             },