From e74612b6fa5014105c6d2eac91125f8c0ecb6479 Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Fri, 19 Jan 2024 09:56:49 +0530 Subject: [PATCH] refactor: disable loader warnings --- src/helpers.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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