Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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")
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
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.