Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
gatsby-adapter-netlify
Advanced tools
This adapter enables following features on Netlify:
imageCDN
option)This adapter is part of Gatsby's zero-configuration deployments feature and will be installed automatically on Netlify. You can add gatsby-adapter-netlify
to your dependencies
and gatsby-config
to have more robust installs and to be able to change its options.
npm install gatsby-adapter-netlify
Add gatsby-adapter-netlify
to your gatsby-config
and configure the adapter
option.
const adapter = require("gatsby-adapter-netlify").default
module.exports = {
adapter: adapter({
excludeDatastoreFromEngineFunction: false,
imageCDN: false,
}),
}
(optional, default: false
)
If true
, Gatsby will not include the LMDB datastore in the serverless functions used for SSR/DSG. Instead, it will upload the datastore to Netlify's CDN and download it on first load of the functions.
You can also enable this option by setting GATSBY_EXCLUDE_DATASTORE_FROM_BUNDLE=true
environment variable (useful when using zero-configuration deployments)
(optional, default: false
)
If true
instead of downloading and processing images at build time, it defers processing until request time using Netlify Image CDN. This can greatly improve build times for sites with remote images, such as those that use a CMS.
You can also enable this option by setting NETLIFY_IMAGE_CDN=true
environment variable (useful when using zero-configuration deployments)
You will need additional configuration in your netlify.toml
configuration file to allow external domains for images. See Netlify Image CDN Remote Path docs for more information.
Exact Remote Path regular expressions to use will depend on CMS you use and possibly your configuration of it.
gatsby-source-contentful
:
[images]
remote_images = [
# <your-contentful-space-id> is specified in the `spaceId` option for the
# gatsby-source-contentful plugin in your gatsby-config file.
"https://images.ctfassets.net/<your-contentful-space-id>/.*"
]
gatsby-source-drupal
:
[images]
remote_images = [
# <your-drupal-base-url> is speciafied in the `baseUrl` option for the
# gatsby-source-drupal plugin in your gatsby-config file.
"<your-drupal-base-url>/.*"
]
gatsby-source-wordpress
:
[images]
remote_images = [
# <your-wordpress-url> is specified in the `url` option for the
# gatsby-source-wordpress plugin in your gatsby-config file.
# There is no need to include `/graphql in the path here`
"<your-wordpress-url>/.*"
]
Above examples are the most likely ones to be needed. However if you configure your CMS to host assets on different domain or path, you might need to adjust the patterns accordingly.
If you are using recent versions of Contentful, Drupal or Wordpress source plugins, Gatsby and Netlify Adapter will automatically detect missing Remote Path patterns and will warn you about it and provide the required patterns to add to your configuration.
FAQs
Gatsby adapter for Netlify
The npm package gatsby-adapter-netlify receives a total of 38,288 weekly downloads. As such, gatsby-adapter-netlify popularity was classified as popular.
We found that gatsby-adapter-netlify demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.