Skip to content

Commit 26feae4

Browse files
authored
fix(gatsby): fix api function compilation on Windows (#38489)
1 parent d1e6aea commit 26feae4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/gatsby/src/internal-plugins/functions/api-function-webpack-loader.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import { slash } from "gatsby-core-utils"
12
import type { LoaderDefinition } from "webpack"
23

34
const APIFunctionLoader: LoaderDefinition = async function () {
45
const params = new URLSearchParams(this.resourceQuery)
56
const matchPath = params.get(`matchPath`)
67

7-
const modulePath = this.resourcePath
8+
const modulePath = slash(this.resourcePath)
89

910
return /* javascript */ `
1011
const preferDefault = m => (m && m.default) || m

0 commit comments

Comments
 (0)