From 228efc560f93c9b5d8165d40403092faac65390c Mon Sep 17 00:00:00 2001 From: Scotty Waggoner Date: Mon, 14 Dec 2020 15:55:10 -0800 Subject: [PATCH] Add env variable to disable transpiling with typescript - Allows developer to force TS to be compiled with babel --- CHANGELOG.md | 4 +++- source/runner/runners/utils/transpiler.ts | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7095a6c2c..c252d4bb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,9 @@ - +- Add `DANGER_DISABLE_TSC` environment variable to disable transpiling with tsc, providing a way to force transpiling + with Babel - [@ozzieorca] + # 10.5.4 diff --git a/source/runner/runners/utils/transpiler.ts b/source/runner/runners/utils/transpiler.ts index 4174ce8f1..e35d0f504 100644 --- a/source/runner/runners/utils/transpiler.ts +++ b/source/runner/runners/utils/transpiler.ts @@ -9,6 +9,7 @@ const enum BabelPackagePrefix { } const disableTranspilation = process.env.DANGER_DISABLE_TRANSPILATION === "true" +const disableTsc = process.env.DANGER_DISABLE_TSC === "true" let hasNativeTypeScript = false let hasBabel = false @@ -30,7 +31,7 @@ export const checkForNodeModules = () => { try { require.resolve("typescript") // tslint:disable-line - hasNativeTypeScript = true + hasNativeTypeScript = true && !disableTsc } catch (e) { d("Does not have TypeScript set up") }