@vercel/gatsby-plugin-vercel-builder
Advanced tools
Comparing version 2.0.8 to 2.0.9
@@ -108,3 +108,4 @@ "use strict"; | ||
outDir, | ||
handlerFile | ||
handlerFile, | ||
prefix = "" | ||
}) => { | ||
@@ -123,3 +124,4 @@ const { major } = await (0, import_build_utils.getNodeVersion)(process.cwd()); | ||
define: { | ||
"process.env.NODE_ENV": "'production'" | ||
"process.env.NODE_ENV": "'production'", | ||
vercel_pathPrefix: JSON.stringify(prefix) | ||
} | ||
@@ -208,3 +210,3 @@ }); | ||
await Promise.all([ | ||
writeHandler({ outDir: functionDir, handlerFile }), | ||
writeHandler({ outDir: functionDir, handlerFile, prefix }), | ||
copyFunctionLibs({ functionDir }), | ||
@@ -211,0 +213,0 @@ copyHTMLFiles({ functionDir }), |
{ | ||
"name": "@vercel/gatsby-plugin-vercel-builder", | ||
"version": "2.0.8", | ||
"version": "2.0.9", | ||
"main": "dist/index.js", | ||
@@ -17,3 +17,3 @@ "files": [ | ||
"@sinclair/typebox": "0.25.24", | ||
"@vercel/build-utils": "7.2.2", | ||
"@vercel/build-utils": "7.2.3", | ||
"@vercel/routing-utils": "3.1.0", | ||
@@ -27,2 +27,3 @@ "esbuild": "0.14.47", | ||
"@types/fs-extra": "11.0.1", | ||
"@types/jest": "27.5.1", | ||
"@types/node": "14.18.33", | ||
@@ -35,4 +36,6 @@ "@types/react": "18.0.26", | ||
"build": "node ../../utils/build-builder.mjs", | ||
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail --runInBand", | ||
"test-unit": "pnpm test test/unit.*test.*", | ||
"type-check": "tsc --noEmit" | ||
} | ||
} |
import os from 'os'; | ||
import etag from 'etag'; | ||
import { parse } from 'url'; | ||
import { join } from 'path'; | ||
import { copySync, existsSync } from 'fs-extra'; | ||
import { join, dirname, basename } from 'path'; | ||
import { getPageName } from './utils'; | ||
@@ -28,24 +28,4 @@ const TMP_DATA_PATH = join(os.tmpdir(), 'data/datastore'); | ||
export default async function handler(req, res) { | ||
let pageName; | ||
const pathname = parse(req.url).pathname || '/'; | ||
const isPageData = pathname.startsWith('/page-data/'); | ||
if (isPageData) { | ||
// /page-data/index/page-data.json | ||
// /page-data/using-ssr/page-data.json | ||
pageName = basename(dirname(pathname)); | ||
if (pageName === 'index') { | ||
pageName = '/'; | ||
} | ||
} else { | ||
// /using-ssr | ||
// /using-ssr/ | ||
// /using-ssr/index.html | ||
pageName = basename(pathname); | ||
if (pageName === 'index.html') { | ||
pageName = basename(dirname(pathname)); | ||
} | ||
if (!pageName) { | ||
pageName = '/'; | ||
} | ||
} | ||
// eslint-disable-next-line no-undef | ||
const { pathName, isPageData } = getPageName(req.url, vercel_pathPrefix); | ||
@@ -56,3 +36,3 @@ const [graphqlEngine, { getData, renderHTML, renderPageData }] = | ||
const data = await getData({ | ||
pathName: pageName, | ||
pathName, | ||
graphqlEngine, | ||
@@ -59,0 +39,0 @@ req, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28660
7
443
7
+ Added@vercel/build-utils@7.2.3(transitive)
- Removed@vercel/build-utils@7.2.2(transitive)
Updated@vercel/build-utils@7.2.3