Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

gatsby-plugin-vercel-deploy

NPM package MIT Licensed

Automatically generate vercel.json from the gatsby project.

Install & Usage

yarn add gatsby-plugin-vercel-deploy

And add plugin to the gatsby-config.js

{
  plugins: [
    'gatsby-plugin-vercel-deploy',
  ],
}

Custom headers

You can define custom headers via plugin options.

{
  plugins: [
    {
      resolve: 'gatsby-plugin-vercel-deploy',
      options: {
        headers: {
          source: '/service-worker.js',
          headers: [
            {
              key: 'Cache-Control',
              value: 'public, max-age=0, must-revalidate',
            },
          ],
        },
        {
          source: '/(.*)',
          headers: [
            {
              key: 'X-Content-Type-Options',
              value: 'nosniff',
            },
            {
              key: 'X-Frame-Options',
              value: 'DENY',
            },
            {
              key: 'X-XSS-Protection',
              value: '1; mode=block',
            },
          ],
        },
      },
    },
  ],
}

LICENSE

MIT

© 2023 Gatsby, Inc.