
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
gatsby-plugin-preconnect
Advanced tools
Gatsby plugin to add the crossorigin attribute to every <link rel="preload"> tag
Quickly add a <link rel="preconnect" crossorigin>
tag for every specified domain.
npm install --save gatsby-plugin-preconnect
It simply adds a <link rel="preconnect" href="https://example.com" crossorigin>
to the page (see the
Resource Prioritization - Preconnect
guide).
// In your gatsby-config.js
plugins: [
{
resolve: 'gatsby-plugin-preconnect',
options: {
domains: ['https://foo.com', 'https://bar.com'],
},
},
]
crossOrigin
is set to true
by default but it can be customized, below all the available options
plugins: [
{
resolve: 'gatsby-plugin-preconnect',
options: {
domains: [
'https://foo.com',
'https://bar.com',
{ domain: 'https://enablecors.com', crossOrigin: true },
{ domain: 'https://disablecors.com', crossOrigin: false },
{ domain: 'https://corswithanonymous.com', crossOrigin: 'anonymous' },
{ domain: 'https://corswithcreds.com', crossOrigin: 'use-credentials' },
],
},
},
]
All the available values for crossOrigin
are listed below, every other value makes the plugin throw an error
Value | Equivalent value |
---|---|
undefined | "anonymous" |
true | "anonymous" |
"anonymous" | "anonymous" |
"use-credentials" | "use-credentials" |
false | (attribute not added) |
PR or issues are welcome 👋
npm run build
on the root
then, in every test project, you need to run npm run plugin:link
to locally use itThanks goes to these wonderful people (emoji key):
Stefano Magni 💻 📖 | Dugagjin Lashi 💻 👀 | Sean King 🤔 | Andrew Schneider 💻 📖 ⚠️ | Andreas Donig 🤔 |
This project follows the all-contributors specification. Contributions of any kind welcome!
FAQs
Gatsby plugin to add the crossorigin attribute to every <link rel="preload"> tag
The npm package gatsby-plugin-preconnect receives a total of 10,132 weekly downloads. As such, gatsby-plugin-preconnect popularity was classified as popular.
We found that gatsby-plugin-preconnect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.