Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vercel/gatsby-plugin-vercel-builder

Package Overview
Dependencies
Maintainers
9
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vercel/gatsby-plugin-vercel-builder - npm Package Compare versions

Comparing version 2.0.8 to 2.0.9

templates/utils.ts

8

dist/index.js

@@ -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,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc