@@ -6,6 +6,8 @@ const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPl
6
6
const glob = require ( "glob" ) ;
7
7
const path = require ( "path" ) ;
8
8
9
+ const nodeFlags = "--experimental-modules --experimental-json-modules --experimental-specifier-resolution=node --no-warnings --no-deprecation" ;
10
+
9
11
/**
10
12
* Grunt configuration for building the app in various formats.
11
13
*
@@ -349,23 +351,23 @@ module.exports = function (grunt) {
349
351
command : "git gc --prune=now --aggressive"
350
352
} ,
351
353
sitemap : {
352
- command : " node --experimental-modules --no-warnings --no-deprecation src/web/static/sitemap.mjs > build/prod/sitemap.xml" ,
354
+ command : ` node ${ nodeFlags } src/web/static/sitemap.mjs > build/prod/sitemap.xml` ,
353
355
sync : true
354
356
} ,
355
357
generateConfig : {
356
358
command : chainCommands ( [
357
359
"echo '\n--- Regenerating config files. ---'" ,
358
360
"echo [] > src/core/config/OperationConfig.json" ,
359
- " node --experimental-modules --no-warnings --no-deprecation src/core/config/scripts/generateOpsIndex.mjs" ,
360
- " node --experimental-modules --no-warnings --no-deprecation src/core/config/scripts/generateConfig.mjs" ,
361
+ ` node ${ nodeFlags } src/core/config/scripts/generateOpsIndex.mjs` ,
362
+ ` node ${ nodeFlags } src/core/config/scripts/generateConfig.mjs` ,
361
363
"echo '--- Config scripts finished. ---\n'"
362
364
] ) ,
363
365
sync : true
364
366
} ,
365
367
generateNodeIndex : {
366
368
command : chainCommands ( [
367
369
"echo '\n--- Regenerating node index ---'" ,
368
- " node --experimental-modules --no-warnings --no-deprecation src/node/config/scripts/generateNodeIndex.mjs" ,
370
+ ` node ${ nodeFlags } src/node/config/scripts/generateNodeIndex.mjs` ,
369
371
"echo '--- Node index generated. ---\n'"
370
372
] ) ,
371
373
sync : true
@@ -393,21 +395,21 @@ module.exports = function (grunt) {
393
395
testCJSNodeConsumer : {
394
396
command : chainCommands ( [
395
397
`cd ${ nodeConsumerTestPath } ` ,
396
- " node --no-warnings cjs-consumer.js" ,
398
+ ` node ${ nodeFlags } cjs-consumer.js` ,
397
399
] ) ,
398
400
stdout : false ,
399
401
} ,
400
402
testESMNodeConsumer : {
401
403
command : chainCommands ( [
402
404
`cd ${ nodeConsumerTestPath } ` ,
403
- " node --no-warnings --experimental-modules esm-consumer.mjs" ,
405
+ ` node ${ nodeFlags } esm-consumer.mjs` ,
404
406
] ) ,
405
407
stdout : false ,
406
408
} ,
407
409
testESMDeepImportNodeConsumer : {
408
410
command : chainCommands ( [
409
411
`cd ${ nodeConsumerTestPath } ` ,
410
- " node --no-warnings --experimental-modules esm-deep-import-consumer.mjs" ,
412
+ ` node ${ nodeFlags } esm-deep-import-consumer.mjs` ,
411
413
] ) ,
412
414
stdout : false ,
413
415
} ,
0 commit comments