Browse Source

Support json modules

This is need for builds on Node/NPM 16
Thomas Weißschuh 3 years ago
parent
commit
83c6775038
2 changed files with 9 additions and 9 deletions
  1. 6 6
      Gruntfile.js
  2. 3 3
      package.json

+ 6 - 6
Gruntfile.js

@@ -349,15 +349,15 @@ module.exports = function (grunt) {
                 command: "git gc --prune=now --aggressive"
             },
             sitemap: {
-                command: "node --experimental-modules --no-warnings --no-deprecation src/web/static/sitemap.mjs > build/prod/sitemap.xml",
+                command: "node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation 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 --experimental-modules --no-warnings --no-deprecation src/core/config/scripts/generateOpsIndex.mjs",
-                    "node --experimental-modules --no-warnings --no-deprecation src/core/config/scripts/generateConfig.mjs",
+                    "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",
                     "echo '--- Config scripts finished. ---\n'"
                 ]),
                 sync: true
@@ -365,7 +365,7 @@ module.exports = function (grunt) {
             generateNodeIndex: {
                 command: chainCommands([
                     "echo '\n--- Regenerating node index ---'",
-                    "node --experimental-modules --no-warnings --no-deprecation src/node/config/scripts/generateNodeIndex.mjs",
+                    "node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation src/node/config/scripts/generateNodeIndex.mjs",
                     "echo '--- Node index generated. ---\n'"
                 ]),
                 sync: true
@@ -400,14 +400,14 @@ module.exports = function (grunt) {
             testESMNodeConsumer: {
                 command: chainCommands([
                     `cd ${nodeConsumerTestPath}`,
-                    "node --no-warnings --experimental-modules esm-consumer.mjs",
+                    "node --no-warnings --experimental-modules --experimental-json-modules esm-consumer.mjs",
                 ]),
                 stdout: false,
             },
             testESMDeepImportNodeConsumer: {
                 command: chainCommands([
                     `cd ${nodeConsumerTestPath}`,
-                    "node --no-warnings --experimental-modules esm-deep-import-consumer.mjs",
+                    "node --no-warnings --experimental-modules --experimental-json-modules esm-deep-import-consumer.mjs",
                 ]),
                 stdout: false,
             },

+ 3 - 3
package.json

@@ -66,7 +66,7 @@
     "imports-loader": "^3.0.0",
     "mini-css-extract-plugin": "1.3.7",
     "nightwatch": "^1.7.8",
-    "node-sass": "^5.0.0",
+    "node-sass": "^6.0.0",
     "postcss": "^8.3.6",
     "postcss-css-variables": "^0.18.0",
     "postcss-import": "^14.0.2",
@@ -169,13 +169,13 @@
     "start": "npx grunt dev",
     "build": "npx grunt prod",
     "repl": "node src/node/repl.js",
-    "test": "npx grunt configTests && node --experimental-modules --no-warnings --no-deprecation tests/node/index.mjs && node --experimental-modules --no-warnings --no-deprecation tests/operations/index.mjs",
+    "test": "npx grunt configTests && node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation tests/node/index.mjs && node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation tests/operations/index.mjs",
     "test-node-consumer": "npx grunt testnodeconsumer",
     "testui": "npx grunt testui",
     "testuidev": "npx nightwatch --env=dev",
     "lint": "npx grunt lint",
     "postinstall": "npx grunt exec:fixCryptoApiImports",
-    "newop": "node --experimental-modules src/core/config/scripts/newOperation.mjs",
+    "newop": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newOperation.mjs",
     "getheapsize": "node -e 'console.log(`node heap limit = ${require(\"v8\").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'",
     "setheapsize": "export NODE_OPTIONS=--max_old_space_size=2048"
   }