From 26feae40fd79105519b85e87bba33d69c48bae10 Mon Sep 17 00:00:00 2001 From: Michal Piechowiak Date: Mon, 28 Aug 2023 13:49:19 +0200 Subject: [PATCH] fix(gatsby): fix api function compilation on Windows (#38489) --- .../internal-plugins/functions/api-function-webpack-loader.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/gatsby/src/internal-plugins/functions/api-function-webpack-loader.ts b/packages/gatsby/src/internal-plugins/functions/api-function-webpack-loader.ts index 1e2578d320dd4..fb7bca935e46c 100644 --- a/packages/gatsby/src/internal-plugins/functions/api-function-webpack-loader.ts +++ b/packages/gatsby/src/internal-plugins/functions/api-function-webpack-loader.ts @@ -1,10 +1,11 @@ +import { slash } from "gatsby-core-utils" import type { LoaderDefinition } from "webpack" const APIFunctionLoader: LoaderDefinition = async function () { const params = new URLSearchParams(this.resourceQuery) const matchPath = params.get(`matchPath`) - const modulePath = this.resourcePath + const modulePath = slash(this.resourcePath) return /* javascript */ ` const preferDefault = m => (m && m.default) || m