diff --git a/src/helpers.ts b/src/helpers.ts index 969da8d..2dcd940 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -33,6 +33,19 @@ const DEFAULT_NODE_ARGS = [ '--enable-source-maps', ] +/** + * Disable experimental warnings, since the ts-node loader hook + * uses an expiremental feature. We are waiting for them to + * cut a new release and support the newer `--import` flag + * instead + */ +if (process.allowedNodeEnvironmentFlags.has('--disable-warning')) { + // supported in node>=v21.13.0 + DEFAULT_NODE_ARGS.push('--disable-warning=ExperimentalWarning') +} else { + DEFAULT_NODE_ARGS.push('--no-warnings') +} + /** * Parses tsconfig.json and prints errors using typescript compiler * host