From 0c95c17fab3f8a9fa872be6bb9ff2105c655af33 Mon Sep 17 00:00:00 2001 From: tyhopp Date: Thu, 17 Mar 2022 15:50:32 +0800 Subject: [PATCH] fix(gatsby-cli): Resolve babel preset ts explicitly --- packages/gatsby-cli/src/handlers/plugin-add-utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gatsby-cli/src/handlers/plugin-add-utils.ts b/packages/gatsby-cli/src/handlers/plugin-add-utils.ts index fd61a58d87a54..e56cd3d845869 100644 --- a/packages/gatsby-cli/src/handlers/plugin-add-utils.ts +++ b/packages/gatsby-cli/src/handlers/plugin-add-utils.ts @@ -43,7 +43,7 @@ const addPluginToConfig = ( // Use the Babel TS preset if we're operating on `gatsby-config.ts` if (srcPath.endsWith(`ts`)) { - transformOptions.presets = [`@babel/preset-typescript`] + transformOptions.presets = [require.resolve(`@babel/preset-typescript`)] } code = transform(src, transformOptions)?.code