mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 04:22:13 +00:00
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.
16 lines
357 B
JavaScript
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');
|
|
};
|