Gatsby Book Launch

“The missing guide to the modern web” launches on Thursday, Sep 29th: Modular: The Web’s New Architecture

ContactSign Up for Free
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

© 2022 Gatsby, Inc.