Files
vercel/packages/static-build/test/fixtures/gatsby-v4/gatsby-node.js
Nathan Rajlich f18fa8546f [static-build] Patch the gatsby-node config file to invoke @vercel/gatsby-plugin-vercel-builder (#9308)
We need to ensure that `@vercel/gatsby-plugin-vercel-builder` is executed as the very last plugin, which Gatsby itself doesn't really support in the plugins listing. So instead we'll patch the `gatsby-node` file to invoke the plugin in the project's own `onPostBuild()` hook, which does get executed last. The patching is similar to how is done with the `gatsby-config` file.
2023-01-25 19:07:04 +00:00

16 lines
357 B
JavaScript

const fs = require('fs');
exports.createPages = async ({ actions }) => {
const { createPage } = actions;
createPage({
path: '/using-dsg',
component: require.resolve('./src/templates/using-dsg.js'),
context: {},
defer: true,
});
};
exports.onPostBuild = async () => {
await fs.promises.copyFile('asset.txt', 'public/asset.txt');
};