Skip to main content
View plugin on GitHub
See starters using this

gatsby-plugin-preconnect

Quickly add a <link rel="preconnect"> tag for every specified domain.

Build Status Build Status Commitizen friendly Open Source
Love

Install

npm install --save gatsby-plugin-preconnect

What this plugin does

It simply adds a <link rel="preconnect" href="https://example.com"> to the page (see the Resource Prioritization - Preconnect guide).

How to use

// In your gatsby-config.js
plugins: [
  {
    resolve: "gatsby-plugin-preconnect",
    options: {
      domains: [
        "https://foo.com",
        "https://bar.com"
      ]
    }
  }
]

Contributing

PR or issues are welcome 👋

Notes

  • if you want to work on the plugin sources, remember that you need to npm run build on the root then, in every test project, you need to run npm run plugin:link to locally use it

Contributors

Thanks goes to these wonderful people (emoji key):

Stefano Magni
Stefano Magni

💻 📖

This project follows the all-contributors specification. Contributions of any kind welcome!