schnogz / gatsby-plugin-preconnect

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

Home Page:https://www.npmjs.com/package/gatsby-plugin-preconnect

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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!

About

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

https://www.npmjs.com/package/gatsby-plugin-preconnect


Languages

Language:JavaScript 51.8%Language:CSS 48.2%