/gatsby-plugin-preconnect

Gatsby plugin to add a <link rel="preconnect"> for every specified domain

Primary LanguageJavaScript

gatsby-plugin-preconnect

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

Build Status Build Status Renovate enabled Commitizen friendly Open Source Love npm

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

💻 📖 👀
Dugagjin Lashi
Dugagjin Lashi

💻

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