mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-09 21:07:46 +00:00
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.
16 lines
422 B
TypeScript
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(),
|
|
});
|
|
};
|