Gatsby plugin to add `<link rel="preload" .../>` tags to the header
npm install gatsby-plugin-preloadGatsby plugin to add tags to the header.
npm install --save gatsby-plugin-preload
- In your gatsby-config.js:
``js
plugins: [
...
{
resolve: 'gatsby-plugin-preload',
options: {
preloaders: [
{
href: "style.css",
as: "style"
},
{
href: "data.json",
as: "fetch",
crossOrigin: "anonymous"
},
{
href: "sintel-short.mp4",
as: "video",
type: "video/mp4"
}
]
}
}
]
`
- Results in:
`html``
...