Files
vercel/packages/gatsby-plugin-vercel-builder/gatsby-node.ts
Nathan Rajlich 6420e54b35 [gatsby-plugin-vercel-builder] Use pathPrefix from BuildArgs (#9362)
Instead of using `pathPrefix` from the Redux store, grab the value
directly from the "BuildArgs" passed to `onPostBuild()`. This value
seems to properly reflect whether or not `--prefix-path` mode was
enabled during the Gatsby build process.
2023-02-01 13:27:24 -07:00

16 lines
422 B
TypeScript

import type { GatsbyNode } from 'gatsby';
// this gets built separately, so import from "dist" instead of "src"
import { generateVercelBuildOutputAPI3Output } from './dist';
export const onPostBuild: GatsbyNode['onPostBuild'] = async ({
pathPrefix,
store,
}) => {
await generateVercelBuildOutputAPI3Output({
pathPrefix,
// validated by `pluginOptionSchema`
gatsbyStoreState: store.getState(),
});
};